home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / TGE133.ZIP;1 / TGE.DOC < prev    next >
Encoding:
Text File  |  1994-07-18  |  128.6 KB  |  2,657 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                The Graphics Engine version 1.33 Documentation
  7.                                 18 July 1994
  8.  
  9.                 The Graphics Engine software and manual are
  10.                Copyright (c) 1993-1994 by Matthew Hildebrand.
  11.                             All rights reserved.
  12.  
  13.  
  14.  
  15.  
  16. Topics covered in this document:
  17. flflflflflflflflflflflflflflflflflflflflflflflflflflflflflflfl
  18.  
  19.      INTRODUCTION
  20.      WHY USE TGE?
  21.      TERMS OF USAGE AND DISTRIBUTION
  22.      SYSTEM REQUIREMENTS
  23.      PACKING LIST
  24.      RELEASE NOTES FOR VERSION 1.33
  25.      A CRASH COURSE IN GRAPHICS PROGRAMMING
  26.      USING TGE IN A PROGRAM
  27.      TGE'S GRAPHICAL FUNCTION SET
  28.      VIEWPORTS AND CLIPPING
  29.      VIRTUAL COORDINATES
  30.      VIRTUAL SCREENS
  31.      GRAPHICAL OUTPUT MODES
  32.      USING FONTS
  33.      BITMAP MANIPULATION
  34.      PALETTE MANIPULATION
  35.      USING THE MOUSE
  36.      TGE'S MOUSE FUNCTION SET
  37.      ADDITIONAL FEATURES IN THE REGISTERED VERSION
  38.      CREATING FONTS
  39.      USING PCX2RAW AND GRAPHICS FILES
  40.      CONTACTING THE AUTHOR
  41.      OBTAINING THE NEWEST VERSION OF TGE
  42.      TROUBLESHOOTING
  43.      ACKNOWLEDGEMENT
  44.      LEGAL STUFF
  45.  
  46.  
  47.  
  48.  
  49. INTRODUCTION
  50. flflflflflflflflflflflfl
  51.  
  52.      The Graphics Engine is the result of my efforts to construct a library
  53.      of routines designed to make writing C/C++ graphics applications
  54.      easier.  I have used it in my own programs with excellent results.
  55.  
  56.      TGE allows the DOS programmer to easily access many graphics modes,
  57.      without having to do special coding for each; the complications
  58.      involved with supporting more than one graphics mode are removed.  TGE
  59.      also provides remarkable flexibility and expandability through its
  60.      modular design.
  61.  
  62.  
  63.  
  64. WHY USE TGE?
  65. flflflflflflflflflflflfl
  66.  
  67.      TGE provides a simple, standard interface with which programs may
  68.      access a powerful library of graphical functions.  TGE supports
  69.      device-independence through the use of loadable drivers; loadable
  70.      fonts; viewports; virtual screens of definable sizes; graphics output
  71.      using COPY, AND, NOT, OR, and XOR, even to virtual screens; bitmap
  72.      scaling; interrupt-driven, definable mouse pointer services; direct
  73.      manipulation of PCX, RAW, and PAL files; and a virtual coordinate
  74.      system to make device-independence easier.
  75.  
  76.      TGE's use of loadable graphics drivers means that all code and data
  77.      necessary to handle any given graphics mode is stored in a disk file.
  78.      When a program runs, this file will be loaded into memory and the code
  79.      and data it contains will be made available.  Consequently:
  80.           - Support for more graphics modes may be added simply by creating
  81.             more drivers; programs need not be recompiled.
  82.           - Since the code to manage the specifics of each mode is
  83.             contained in the drivers, the main program needs not concern
  84.             itself with what mode it is operating in.  The same code can
  85.             work in any graphics mode.
  86.           - Memory is saved for programs which support many graphics modes.
  87.             Instead of keeping the code and data necessary for each in
  88.             memory at all times, only the memory required for one driver is
  89.             used.
  90.  
  91.      The names of TGE's functions, such as "putImage" and "filledRect", may
  92.      easily be changed to suit individual preferences.
  93.  
  94.      TGE is powerful, fast, and cheap.  Upgrades are free.
  95.  
  96.  
  97.  
  98. TERMS OF USAGE AND DISTRIBUTION
  99. flflflflflflflflflflflflflflflflflflflflflflflflflflflflflflfl
  100.  
  101.      TGE is not free; it is distributed on a "try before you buy" basis.
  102.      Permission is granted to use TGE, for evaluation purposes only, for a
  103.      trial period of up to 30 days.  In order to use TGE after the trial
  104.      period, you MUST REGISTER; registration entitles you to free upgrades,
  105.      technical support, royalty-free distribution rights for all software
  106.      written using TGE, and a copy of the registered version of TGE, which
  107.      includes TGE's complete source code, an extra font, and features not
  108.      available in the shareware version.  Failure to register constitutes
  109.      theft and is punishable by law.
  110.  
  111.      By registering a copy of TGE, you signify that you have read and
  112.      understood the terms of usage and distribution explained in this
  113.      document, and that you agree to be bound by these terms; you also
  114.      signify that you agree to release the Author (Matthew Hildebrand) from
  115.      all liability associated with the use of TGE.
  116.  
  117.      In order to register a copy of TGE, send $30 US funds or $40 Canadian
  118.      funds to Matthew Hildebrand at the address listed in the CONTACTING
  119.      THE AUTHOR section of this document.  For each software package which
  120.      is both distributed by a corporation and built using TGE, send an
  121.      additional $100 US funds or $130 Canadian funds (negotiable); this fee
  122.      is a pittance compared to the revenue generated by typical commercial
  123.      packages.  Payment by money order, cheque, or cash is acceptable;
  124.      currency must be US or Canadian funds.  Users outside the USA and
  125.      Canada, please ensure that cheques are drawn on a US or Canadian bank,
  126.      and that money orders are international if necessary.  Also, please
  127.      send a filled out copy of ORDER.FRM with your payment.  Thank you in
  128.      advance for registering TGE; your support is what makes its continued
  129.      growth possible.
  130.  
  131.      Upon receipt of your registration, I will mail you a copy of the
  132.      registered version of TGE, which includes complete source code, an
  133.      extra font, and features not available in the shareware version; this
  134.      registered copy of TGE may not be distributed in any way.  Once I have
  135.      mailed you a copy of the registered version, you will be considered a
  136.      registered user.  If you are interested in receiving notifications of
  137.      new versions as they are released, or copies of the new versions
  138.      themselves, refer to paragraph two of the OBTAINING THE NEWEST VERSION
  139.      OF TGE section.
  140.  
  141.      The privileges granted by purchasing TGE may be retracted if any of
  142.      the copyright notices in TGE's source files is modified or removed, if
  143.      any or all of the registered version of TGE is distributed in any way,
  144.      or if any or all of TGE's source code is distributed as part of a
  145.      software package.
  146.  
  147.      The shareware version of TGE may be distributed freely as long as the
  148.      distributed package is complete and its contents are not modified in
  149.      any way, and the distributed package is not sold for profit.
  150.  
  151.  
  152.  
  153. SYSTEM REQUIREMENTS
  154. flflflflflflflflflflflflflflflflflflfl
  155.  
  156.      TGE is a C/C++ programmer's library.  As such, it requires a C or C++
  157.      compiler of some sort to work with it.  TGE was written and tested
  158.      with Borland C++ 2.0 and Turbo C 2.0; it may work with other C/C++
  159.      compilers as well.
  160.  
  161.      The drivers that come with TGE are written using 80386 instructions;
  162.      they therefore cannot be used on a processor older than the 386 unless
  163.      they are modified first.
  164.  
  165.      The font and virtual coordinate systems are written in C++, not C.  In
  166.      order to use loadable fonts or VCOORD.H, a C++ compiler will be
  167.      required.
  168.  
  169.  
  170.  
  171. PACKING LIST
  172. flflflflflflflflflflflfl
  173.  
  174.      The current version of TGE consists of the following files:
  175.  
  176.      \TGE\               <DIR>
  177.          TGE.DOC                   TGE documentation.
  178.          QUICKREF.DOC              TGE function library quick reference.
  179.          REVISION.HST              Revision history.
  180.          ORDER.FRM                 Order form (shareware version only).
  181.          UNIVESA.DOC               Universal VESA TSR documentation.
  182.          UNIVESA.EXE               Universal VESA TSR executable.
  183.          README.NOW                Important information.
  184.          FILE_ID.DIZ               Archive description file used by some
  185.                                      bulletin board systems (shareware
  186.                                      version only).
  187.      \TGE\INCLUDE\       <DIR> TGE include files.
  188.          TGE.H                     TGE main header file.
  189.          FIXFONT.H                 Fixed-size font header file (C++).
  190.          VARFONT.H                 Variable-sized font header file (C++).
  191.          TGEMOUSE.H                Mouse header file.
  192.          VCOORD.H                  Virtual coordinate system (C++).
  193.        \TGE\LIB\         <DIR> Library directory.
  194.          BCL.MAK                   Makefile for Borland C++ large model
  195.                                      library.
  196.          BCH.MAK                   Makefile for Borland C++ huge model
  197.                                      library.
  198.          TGELIB.LST                Listfile used by library makefiles.
  199.          BCL.LIB                   Borland C++ large model library.
  200.          BCH.LIB                   Borland C++ huge model library.
  201.        \TGE\UTIL\        <DIR> PCX2RAW and MAKEFONT utilitites.
  202.          PCX2RAW.C                 Source for PCX2RAW.
  203.          PCX2RAW.EXE               Convert PCX files to RAW and PAL files.
  204.          MAKEFONT.C                Source for MAKEFONT.
  205.          MAKEFONT.EXE              Make a font from individual bitmaps.
  206.        \TGE\DRIVERS\     <DIR> Loadable drivers.
  207.          320X200.DRV               Driver for VGA 320x200x256.
  208.          320X240.DRV               Driver for VGA 320x240x256.
  209.          320X400.DRV               Driver for VGA 320x400x256.
  210.          360X480.DRV               Driver for VGA 360x480x256.
  211.          640X480.DRV               Driver for SuperVGA 640x480x256.
  212.          800X600.DRV               Driver for SuperVGA 800x600x256.
  213.          1024X768.DRV              Driver for SuperVGA 1024x768x256.
  214.        \TGE\FONTS\       <DIR> Loadable fonts.
  215.          BIGTEXT.FNT               Big letters (variable-sized).
  216.          8X8.FNT                   8x8 font (fixed-size).
  217.          8X14.FNT                  8x14 font (fixed-size).
  218.          8X16.FNT                  8x16 font (fixed-size).
  219.        \TGE\DEMO\        <DIR> Demo programs.
  220.          TGEDEMO.DOC               Documentation for demo program.
  221.          TGEDEMO.CPP               Source code for demo program.
  222.          MAKEFILE                  Makefile for the demo program.
  223.          TGEDEMO.EXE               TGE demo program executable.
  224.          TGELOGO.RAW               Data file used by the TGE demo program.
  225.          SIMPLE.CPP                A skeleton TGE program showing interface
  226.                                      basics.
  227.  
  228.      If you did not receive all of these files, you have an illegal copy of
  229.      The Graphics Engine.
  230.  
  231.  
  232.  
  233. RELEASE NOTES FOR VERSION 1.33
  234. flflflflflflflflflflflflflflflflflflflflflflflflflflflflflfl
  235.  
  236.      IN ORDER TO USE THE C++ PORTIONS OF TGE, YOU MUST DISABLE THE "FAR
  237.      VIRTUAL TABLES" OPTION (-Vf- FROM THE COMMAND LINE).  IF YOU DO NOT,
  238.      YOU WILL GET LINKER ERRORS.
  239.  
  240.      For a complete list of changes, refer to the REVISION.HST file.
  241.  
  242.      The drivers used with this release are not compatible with those from
  243.      version 1.31 or older, since changes have been made to the driver
  244.      structure in order to allow for new features.
  245.  
  246.  
  247.  
  248. A CRASH COURSE IN GRAPHICS PROGRAMMING
  249. flflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflfl
  250.  
  251.      A graphics screen is composed of thousands or even hundreds of
  252.      thousands of coloured dots called "pixels".  Each pixel is referenced
  253.      according to its offset, in coordinate form, from the upper-left of
  254.      the screen:  (0,0), or the "origin".  The 'x' of a pixel's (x,y)
  255.      location signifies the column number, and the 'y' signifies the row
  256.      number; for example, a 640x480 screen would have (0,0) in the upper-
  257.      left and (639,479) in the lower-right.
  258.  
  259.      Each of these pixels has a colour which is recorded as a number,
  260.      ranging from 0..255 in 256-colour modes.  Each of these numbers is an
  261.      index into a table of colours which the video card maintains:  the
  262.      "palette".  The palette is what determines which colour is represented
  263.      by certain numbers; for instance, what colour is colour number 196?
  264.      Blue?  Green?  Purple?  It depends on the current setting of the
  265.      palette register for colour number 196.
  266.  
  267.      Each of these palette registers consists of three components:  the
  268.      red, green, and blue values, each of which is in the range 0..255.
  269.      All the displayable colours are composed of these three primary
  270.      colours in some proportion.  For instance, a purple would have lots of
  271.      red and blue, but little or no green.
  272.  
  273.      The palette can be a powerful tool, as changing palette register, say,
  274.      48, causes all pixels on-screen with the value of 48 to instantly
  275.      change to the new colour.  It is important to keep in mind that the
  276.      palette is a global palette; ie. it affects the entire screen.
  277.  
  278.      That's all there is to it!  <grin>
  279.  
  280.  
  281.  
  282. USING TGE IN A PROGRAM
  283. flflflflflflflflflflflflflflflflflflflflflfl
  284.  
  285.      IN ORDER TO USE THE C++ PORTIONS OF TGE, YOU MUST DISABLE THE "FAR
  286.      VIRTUAL TABLES" OPTION (-Vf- FROM THE COMMAND LINE).  IF YOU DO NOT,
  287.      YOU WILL GET LINKER ERRORS.
  288.  
  289.      TGE now uses two environment variables:  TGEDRIVERS and TGEFONTS.
  290.      Though these environement variables are not necessary, it is
  291.      recommended that you add the following lines to your AUTOEXEC.BAT
  292.      file:
  293.           set TGEDRIVERS=drive:\tge\drivers\
  294.           set TGEFONTS=drive:\tge\fonts\
  295.      where 'drive:' is the drive on which you installed TGE.  The trailing
  296.      backslash is required.
  297.  
  298.  
  299.      Incorporating TGE into a program is an easy process involving three
  300.      simple steps.  First, you must be sure that TGE is recognized by the
  301.      program; to do so, #include the header file TGE.H into any source file
  302.      which accesses any of TGE's routines; you may also need to #include
  303.      other header files, such as TGEMOUSE.H if you use TGE's mouse code.
  304.      Also, ensure that the appropriate library file is linked in with the
  305.      program's OBJ files to make the EXE file; available library files are
  306.      BCL.LIB (Borland C++ large model) and BCH.LIB (Borland C++ huge
  307.      model).
  308.  
  309.      BE SURE TO ONLY LINK OBJECT FILES WHICH WERE COMPILED WITH THE "FAR
  310.      VIRTUAL TABLES" OPTION DISABLED.  ATTEMPTS TO LINK MODULES COMPILED
  311.      WITH THIS OPTION ENABLED MAY RESULT IN LINKER ERRORS.  IN ORDER TO
  312.      DISABLE THIS OPTION, USE THE -Vf- COMMAND LINE PARAMETER, OR USE THE
  313.      IDE'S OPTIONS->COMPILER->C++ OPTIONS MENU.
  314.  
  315.      Second, a graphics driver MUST be loaded before any code or data
  316.      contained in the driver is accessed; results are undefined (though
  317.      almost certainly bad) if this step is not taken.  Code to load a
  318.      driver might look like this:
  319.  
  320.           if (loadGraphDriver(drvFileName) != TGE_SUCCESS)
  321.           {
  322.             printf("Error loading driver %s; aborting.\n\n", drvFileName);
  323.             exit(EXIT_FAILURE);
  324.           }
  325.           else
  326.             atexit(unloadGraphDriver);
  327.  
  328.      As its only parameter, loadGraphDriver() takes a string consisting of
  329.      the file name (which may include any valid DOS path) of the driver to
  330.      be loaded; note that if the specified filename cannot be found, TGE
  331.      will attempt to load it from the directory specified by the TGEDRIVERS
  332.      environment variable.  loadGraphDriver() returns TGE_SUCCESS if the
  333.      loading was successful, or one of TGE_OPEN_ERR (file not found),
  334.      TGE_FORMAT_ERR (file is not a valid TGE driver), TGE_ALLOC_ERR (out of
  335.      memory), and TGE_FILE_ERR (general file I/O error) if an error
  336.      occurred.  These macros are defined in TGE.H.
  337.  
  338.      Third, after TGE's graphical functions are no longer needed (usually
  339.      just before a program exit), the function unloadGraphDriver() should
  340.      be called.  It takes no parameters, and returns nothing.  It simply
  341.      frees the memory taken up by a driver after it has been loaded.  (With
  342.      some compilers it is not necessary to call this function, but it's
  343.      safer to call it just to be sure.)  It is generally a good idea to
  344.      place unloadGraphDriver() in the atexit() queue, as was done in the
  345.      above code fragment.
  346.  
  347.  
  348.      Note that the initGraphics() function must be called to enter graphics
  349.      mode; for more information, see the next section.  For more
  350.      information on how to use any particular feature, refer to the
  351.      appropriate section of this document.
  352.  
  353.  
  354.  
  355. TGE'S GRAPHICAL FUNCTION SET
  356. flflflflflflflflflflflflflflflflflflflflflflflflflflflfl
  357.  
  358.      After a driver has been loaded, all of TGE's graphical functions can
  359.      be accessed.  To call a function, simply execute
  360.  
  361.           functionName(parameter_list);
  362.  
  363.      where "functionName" is the name of the desired function (eg.
  364.      "ellipse" or "filledRect") and "parameter_list" is all parameters to
  365.      that function, if any.
  366.  
  367.      A complete list of TGE's graphical functions follows.
  368.  
  369.  
  370.  *** Function:      initGraphics()
  371.      Syntax:        void initGraphics(void);
  372.      Purpose:       Initialize graphics mode.
  373.      Parameters:    None.
  374.      Return value:  1 on success or 0 on error.
  375.      Remarks:       None.
  376.      See also:      deInitGraphics()
  377.  
  378.  *** Function:      deInitGraphics()
  379.      Syntax:        void deInitGraphics(void);
  380.      Purpose:       Revert to 80x25 colour text mode.
  381.      Parameters:    None.
  382.      Return value:  None.
  383.      Remarks:       None.
  384.      See also:      initGraphics()
  385.  
  386.  *** Function:      putImage()
  387.      Syntax:        void huge putImage(int x, int y, void far *image);
  388.      Purpose:       Place a bitmap, or image, onto the screen.
  389.      Parameters:    The bitmap contained in 'image' will be placed onto the
  390.                     screen with its upper-left coordinate at ('x','y').
  391.      Return value:  None.
  392.      Remarks:            Clipping is performed; the image may be placed
  393.                     entirely on-screen, partially on-screen, or entirely
  394.                     off-screen.
  395.                          This function is declared as huge so that it will
  396.                     work properly when called from within an interrupt
  397.                     service routine.
  398.      See also:      putImageInv(), getImage(), imageSize(), imageSizeDim(),
  399.                     putHorizLine(), putHorizLineInv(), getHorizLine()
  400.  
  401.  *** Function:      putImageInv()
  402.      Syntax:        void huge putImageInv(int x, int y, void far *image);
  403.      Purpose:       Place a bitmap, or image, on the screen.
  404.      Parameters:    The bitmap contained in 'image' will be placed onto the
  405.                     screen with its upper-left coordinate at ('x','y').
  406.      Return value:  None.
  407.      Remarks:            Clipping is performed; the image may be placed
  408.                     entirely on-screen, partially on-screen, or entirely
  409.                     off-screen.    putImageInv() differs from putImage()
  410.                     only in that it allows for transparent, or invisible,
  411.                     colours.  If any pixel in the image buffer has a value
  412.                     of zero, the corresponding pixel on-screen will not be
  413.                     modified.  Using putImageInv() can avoid having black
  414.                     borders around non-rectangular shapes.
  415.                          This function is declared as huge so that it will
  416.                     work properly when called from within an interrupt
  417.                     service routine.
  418.      See also:      putImage(), getImage(), imageSize(), imageSizeDim(),
  419.                     putHorizLineInv(), putHorizLine(), getHorizLine()
  420.  
  421.  *** Function:      getImage()
  422.      Syntax:        void huge getImage(int ulx, int uly, int lrx, int lry,
  423.                     void far *image);
  424.      Purpose:       Copy the specified rectangular portion of the screen to
  425.                     memory.
  426.      Parameters:    The portion of the screen with its upper-left
  427.                     coordinate at ('ulx','uly') and its lower-left
  428.                     coordinate at ('lrx','lry') will be copied into the
  429.                     previously allocated memory region at 'image' (see
  430.                     imageSize()).
  431.      Return value:  None.
  432.      Remarks:            Clipping is performed.  Note that only the portion
  433.                     of the specified region which lies within the current
  434.                     viewport will be placed in the image buffer by
  435.                     getImage().  Be careful not to assume that a getImage()
  436.                     image has off-screen data in it.
  437.                          This function is declared as huge so that it will
  438.                     work properly when called from within an interrupt
  439.                     service routine.
  440.      See also:      putImage(), putImageInv(), imageSize(), imageSizeDim(),
  441.                     getHorizLine(), putHorizLine(), putHorizLineInv()
  442.  
  443.  *** Function:      imageSize()
  444.      Syntax:        unsigned long imageSize(int ulx, int uly, int lrx, int
  445.                     lry);
  446.      Purpose:       Determine the amount of memory required to hold a
  447.                     rectangular portion of the screen.
  448.      Parameters:    imageSize() will calculate the amount of memory
  449.                     required to hold the porion of the screen whose upper-
  450.                     left coordinate is ('ulx','uly') and whose lower-left
  451.                     coordinate is ('lrx','lry').
  452.      Return value:  imageSize returns an unsigned long containing the size
  453.                     of the area in bytes.
  454.      Remarks:            Clipping is performed.
  455.                          imageSize() is designed for use with putImage(),
  456.                     putImageInv(), and getImage().  To use it with
  457.                     putHorizLine() and getHorizLine(), subtract 4 from the
  458.                     value it returns.  (Image buffers have four bytes of
  459.                     dimension information in them; line buffers do not.)
  460.      See also:      imageSizeDim(), putImage(), putImageInv(), getImage(),
  461.                     putHorizLine(), getHorizLine()
  462.  
  463.  *** Function:      imageSizeDim()
  464.      Syntax:        unsigned long imageSizeDim(unsigned wide, unsigned
  465.                     deep);
  466.      Purpose:       Determine the amount of memory required to hold a
  467.                     rectangular portion of the screen.
  468.      Parameters:    imageSize() will calculate the amount of memory
  469.                     required to hold the porion of the screen with width
  470.                     'wide' and depth 'deep'.
  471.      Return value:  imageSize returns an unsigned long containing the size
  472.                     of the area in bytes.
  473.      Remarks:            Clipping is not performed.
  474.                          imageSizeDim() is designed for use with
  475.                     putImage(), putImageInv(), and getImage().  To use it
  476.                     with putHorizLine() and getHorizLine(), subtract 4 from
  477.                     the value it returns.  (Image buffers have four bytes
  478.                     of dimension information in them; line buffers do not.)
  479.      See also:      imageSize(), putImage(), putImageInv(), getImage(),
  480.                     putHorizLine(), getHorizLine()
  481.  
  482.  *** Function:      putHorizLine()
  483.      Syntax:        void putHorizLine(int y, int xOff, int lineLen, void
  484.                     far *buf);
  485.      Purpose:       Place one horizontal line of image data on the screen.
  486.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  487.                     pixels, will be placed on-screen starting at
  488.                     ('xOff','y').
  489.      Return value:  None.
  490.      Remarks:       No clipping is performed.  Results are undefined if any
  491.                     coordinate on the line is off-screen.
  492.      See also:      putHorizLineInv(), getHorizLine(), putImage(),
  493.                     putImageInv(), getImage()
  494.  
  495.  *** Function:      putHorizLineInv()
  496.      Syntax:        void putHorizLineInv(int y, int xOff, int lineLen, void
  497.                     far *buf);
  498.      Purpose:       Place one horizontal line of image data on the screen,
  499.                     leaving a pixel unchanged if the corresponding pixel in
  500.                     the source buffer has a value of zero.
  501.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  502.                     pixels, will be placed on-screen starting at
  503.                     ('xOff','y').
  504.      Return value:  None.
  505.      Remarks:       No clipping is performed.  Results are undefined if any
  506.                     coordinate on the line is off-screen.
  507.      See also:      putHorizLine(), getHorizLine(), putImage(),
  508.                     putImageInv(), getImage()
  509.  
  510.  *** Function:      getHorizLine()
  511.      Syntax:        void getHorizLine(int y, int xOff, int lineLen, void
  512.                     far *buf);
  513.      Purpose:       Copy one horizontal line from the screen to memory.
  514.      Parameters:    The horizontal line whose left coordinate is
  515.                     ('xOff','y') and whose length is 'lineLen' pixels will
  516.                     be copied into the previously allocated memory region
  517.                     at 'buf'.
  518.      Return value:  None.
  519.      Remarks:       No clipping is performed.  Results are undefined if any
  520.                     coordinate on the line is off-screen.
  521.      See also:      putHorizLine(), putHorizLineInv(), putImage(),
  522.                     putImageInv(), getImage()
  523.  
  524.  *** Function:      putVertLine()
  525.      Syntax:        void putVertLine(int y, int xOff, int lineLen, void far
  526.                     *buf);
  527.      Purpose:       Place one vertical line of image data on the screen.
  528.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  529.                     pixels, will be placed on-screen starting at
  530.                     ('x','yOff').
  531.      Return value:  None.
  532.      Remarks:       No clipping is performed.  Results are undefined if any
  533.                     coordinate on the line is off-screen.
  534.      See also:      putVertLineInv(), getVertLine(), putImage(),
  535.                     putImageInv(), getImage()
  536.  
  537.  *** Function:      putVertLineInv()
  538.      Syntax:        void putVertLineInv(int y, int xOff, int lineLen, void
  539.                     far *buf);
  540.      Purpose:       Place one vertical line of image data on the screen,
  541.                     leaving a pixel unchanged if the corresponding pixel in
  542.                     the source buffer has a value of zero.
  543.      Parameters:    The one-line bitmap contained in 'buf', of 'lineLen'
  544.                     pixels, will be placed on-screen starting at
  545.                     ('x','yOff').
  546.      Return value:  None.
  547.      Remarks:       No clipping is performed.  Results are undefined if any
  548.                     coordinate on the line is off-screen.
  549.      See also:      putVertLine(), getVertLine(), putImage(),
  550.                     putImageInv(), getImage()
  551.  
  552.  *** Function:      getVertLine()
  553.      Syntax:        void getVertLine(int y, int xOff, int lineLen, void far
  554.                     *buf);
  555.      Purpose:       Copy one vertical line from the screen to memory.
  556.      Parameters:    The vertical line whose left coordinate is ('x','yOff')
  557.                     and whose length is 'lineLen' pixels will be copied
  558.                     into the previously allocated memory region at 'buf'.
  559.      Return value:  None.
  560.      Remarks:       No clipping is performed.  Results are undefined if any
  561.                     coordinate on the line is off-screen.
  562.      See also:      putVertLine(), putVertLineInv(), putImage(),
  563.                     putImageInv(), getImage()
  564.  
  565.  *** Function:      putPixel()
  566.      Syntax:        void putPixel(int x, int y, unsigned colour);
  567.      Purpose:       Place a single pixel on-screen.
  568.      Parameters:    The pixel located at ('x','y') will be set to the
  569.                     colour 'colour'.
  570.      Return value:  None.
  571.      Remarks:       Clipping is not performed; see clipPoint() and
  572.                     pointOnScreen() for details on clipping pixels.
  573.      See also:      getPixel()
  574.  
  575.  *** Function:      getPixel()
  576.      Syntax:        unsigned getPixel(int x, int y);
  577.      Purpose:       Return the value of a pixel.
  578.      Parameters:    The value of the pixel at ('x','y') is returned.
  579.      Return value:  The value of the pixel at ('x','y') is returned.
  580.      Remarks:       Clipping is not performed; see clipPoint() and
  581.                     pointOnScreen() for details on clipping pixels.
  582.      See also:      putPixel()
  583.  
  584.  *** Function:      line()
  585.      Syntax:        void line(int x1, int y1, int x2, int y2, unsigned
  586.                     colour);
  587.      Purpose:       Draw a line between two points.
  588.      Parameters:    The line will be drawn joining ('x1','y1') and
  589.                     ('x2','y2') in the colour 'colour'.
  590.      Return value:  None.
  591.      Remarks:       Clipping is not performed; see clipLine() for details
  592.                     on clipping lines.
  593.      See also:      horizLine(), vertLine()
  594.  
  595.  *** Function:      horizLine()
  596.      Syntax:        void horizLine(int y, int x1, int x2, unsigned colour);
  597.      Purpose:       Draw a horizontal line between two points.
  598.      Parameters:    The line will be drawn between ('x1','y') and
  599.                     ('x2','y') in the colour contained in colour.
  600.      Return value:  None.
  601.      Remarks:            Clipping is not performed.
  602.                          'x1' must be less than or equal to 'x2'.
  603.      See also:      vertLine(), line()
  604.  
  605.  *** Function:      vertLine()
  606.      Syntax:        void vertLine(int x, int y1, int y2, unsigned colour);
  607.      Purpose:       Draw a vertical line between two points.
  608.      Parameters:    The line will be drawn between ('x','y1') and
  609.                     ('x','y2') in the colour contained in colour.
  610.      Return value:  None.
  611.      Remarks:            Clipping is not performed.
  612.                          'y1' must be less than or equal to 'y2'.
  613.      See also:      horizLine(), line()
  614.  
  615.  *** Function:      drawRect()
  616.      Syntax:        void drawRect(int ulx, int uly, int lrx, int lry,
  617.                     unsigned colour);
  618.      Purpose:       Draw a rectangle.
  619.      Parameters:    The rectangle will be drawn with its upper-left
  620.                     coordinates at ('ulx','uly') and its lower-left
  621.                     coordinates at ('lrx','lry'), in the colour 'colour'.
  622.      Return value:  None.
  623.      Remarks:       Clipping is performed.
  624.      See also:      filledRect()
  625.  
  626.  *** Function:      filledRect()
  627.      Syntax:        void filledRect(int ulx, int uly, int lrx, int lry,
  628.                     unsigned colour);
  629.      Purpose:       Draw a filled rectangle.
  630.      Parameters:    The rectangle will be drawn with its upper-left
  631.                     coordinates at ('ulx','uly') and its lower-left
  632.                     coordinates at ('lrx','lry'), in the colour 'colour'.
  633.      Return value:  None.
  634.      Remarks:       Clipping is not performed; see clipFilledRect() for
  635.                     details on clipping filledRects.
  636.      See also:      drawRect()
  637.  
  638.  *** Function:      setPaletteReg()
  639.      Syntax:        void setPaletteReg(unsigned palReg, unsigned char red,
  640.                     unsigned char green, unsigned char blue);
  641.      Purpose:       Set a palette register.
  642.      Parameters:    The red, green, and blue components of the palette
  643.                     register palReg will be set to 'red', 'green', and
  644.                     'blue' respectively.
  645.      Return value:  None.
  646.      Remarks:       Each of the colour components ('red', 'green', 'blue')
  647.                     should be in the range 0..255, not 0..63 as would be
  648.                     the case using a stock VGA.  The drivers will take care
  649.                     of converting 8-bit to 6-bit palette resolution if
  650.                     necessary.
  651.      See also:      getPaletteReg(), setBlockPalette(), getBlockPalette()
  652.  
  653.  *** Function:      getPaletteReg()
  654.      Syntax:        void getPaletteReg(unsigned palReg, unsigned char far
  655.                     *red, unsigned char far *green, unsigned char far
  656.                     *blue);
  657.      Purpose:       Return the current settings of a palette register.
  658.      Parameters:    The red, green, and blue contents of the palette
  659.                     register palReg will be stored in 'red', 'green', and
  660.                     'blue' respectively.
  661.      Return value:  The red, green, and blue components of the palette
  662.                     register are returned in 'red', 'green', and 'blue'.
  663.      Remarks:       Each of the colour components ('red', 'green', 'blue')
  664.                     are in the range 0..255, not 0..63 as would be the case
  665.                     using a stock VGA card.  The drivers will take care of
  666.                     converting 8-bit to 6-bit palette resolution if
  667.                     necessary.
  668.      See also:      setPaletteReg(), setBlockPalette(), getBlockPalette()
  669.  
  670.  *** Function:      setBlockPalette()
  671.      Syntax:        void setBlockPalette(unsigned firstReg, unsigned
  672.                     lastReg, void far *data);
  673.      Purpose:       Set a block of palette registers.
  674.      Parameters:    The palette registers starting at 'firstReg' and ending
  675.                     at 'lastReg' will be set to the values contained in
  676.                     'data'.
  677.      Return value:  None.
  678.      Remarks:            The memory region at 'data' is organised in groups
  679.                     of three bytes; each group corresponds to one palette
  680.                     register, and each group is made up of, in order, the
  681.                     red, green, and blue components.  The first group is
  682.                     for the first register, the second for the second, and
  683.                     so on.
  684.                          Each of the colour components (red, green, blue)
  685.                     should be in the range 0..255, not 0..63 as would be
  686.                     the case using a stock VGA.  The drivers will take care
  687.                     of converting 8-bit to 6-bit palette resolution if
  688.                     necessary.
  689.                          Results are undefined if 'lastReg' is less than
  690.                     'firstReg'.
  691.      See also:      getBlockPalette(), setPaletteReg(), getPaletteReg()
  692.  
  693.  *** Function:      getBlockPalette()
  694.      Syntax:        void getBlockPalette(unsigned firstReg, unsigned
  695.                     lastReg, void far *data);
  696.      Purpose:       Get the values of a block of palette registers.
  697.      Parameters:    The values of the palette registers starting at
  698.                     'firstReg' and ending at 'lastReg' will be stored in
  699.                     the previously allocated 'data'.
  700.      Return value:  The values are returned in 'data'.
  701.      Remarks:            The memory region at 'data' is organised in groups
  702.                     of three bytes; each group corresponds to one palette
  703.                     register, and each group is made up of, in order, the
  704.                     red, green, and blue components.  The first group is
  705.                     for the first register, the second for the second, and
  706.                     so on.
  707.                          Each of the colour components (red, green, blue)
  708.                     is in the range 0..255, not 0..63 as would be the case
  709.                     using a stock VGA.  The drivers will take care of
  710.                     converting 8-bit to 6-bit palette resolution if
  711.                     necessary.
  712.                          Results are undefined if 'lastReg' is less than
  713.                     'firstReg'.
  714.      See also:      setBlockPalette(), setPaletteReg(), getPaletteReg()
  715.  
  716.  *** Function:      clearGraphics()
  717.      Syntax:        void clearGraphics(unsigned colour);
  718.      Purpose:       Clear the screen.
  719.      Parameters:    The screen will be cleared to the colour 'colour'.
  720.      Return value:  None.
  721.      Remarks:       This function clears the entire screen, not just the
  722.                     current viewport.
  723.      See also:      filledRect()
  724.  
  725.  *** Function:      ellipse()
  726.      Syntax:        void ellipse(int x, int y, int wide, int deep, unsigned
  727.                     colour);
  728.      Purpose:       Draw the outline of an ellipse.
  729.      Parameters:    An ellipse centered at ('x','y') and having width
  730.                     'wide' and depth 'deep' will be drawn in the colour
  731.                     'colour'.
  732.      Return value:  None.
  733.      Remarks:       Clipping is performed.
  734.      See also:      filledEllipse(), circle(), filledCircle()
  735.  
  736.  *** Function:      filledEllipse()
  737.      Syntax:        void filledEllipse(x, int y, int wide, int deep,
  738.                     unsigned colour);
  739.      Purpose:       Draw a filled ellipse.
  740.      Parameters:    An ellipse centered at ('x','y') and having width
  741.                     'wide' and depth 'deep' will be drawn in the colour
  742.                     'colour'.
  743.      Return value:  None.
  744.      Remarks:       Clipping is performed.
  745.      See also:      ellipse(), filledCircle(), circle()
  746.  
  747.  *** Function:      circle()
  748.      Syntax:        void circle(int x, int y, int radius, unsigned colour);
  749.      Purpose:       Draw the outline of a circle.
  750.      Parameters:    A circle centered at ('x','y') and having radius
  751.                     'radius' will be drawn in the colour 'colour'.
  752.      Return value:  None.
  753.      Remarks:            Clipping is performed.
  754.                          The 'radius' parameter is the radius in pixels
  755.                     measured horizontally.  Although there will be no
  756.                     difference in modes with square pixels, it will make a
  757.                     difference in other modes; to ensure accurate drawing
  758.                     of the circle with the given radius, make certain that
  759.                     the radius is measured horizontally.
  760.                          TGE uses an all-integer approach to coordinate
  761.                     scaling to ensure that the drawn shape will be circular
  762.                     in modes without square pixels.
  763.      See also:      filledCircle(), filledEllipse(), ellipse()
  764.  
  765.  *** Function:      filledCircle()
  766.      Syntax:        void filledCircle(int x, int y, int radius, unsigned
  767.                     colour);
  768.      Purpose:       Draw a filled circle.
  769.      Parameters:    A circle centered at ('x','y') and having radius
  770.                     'radius' will be drawn in the colour 'colour'.
  771.      Return value:  None.
  772.      Remarks:            Clipping is performed.
  773.                          The 'radius' parameter is the radius in pixels
  774.                     measured horizontally.  Although there will be no
  775.                     difference in modes with square pixels, it will make a
  776.                     difference in other modes; to ensure accurate drawing
  777.                     of the circle with the given radius, make certain that
  778.                     the radius is measured horizontally.
  779.                          TGE uses an all-integer approach to coordinate
  780.                     scaling to ensure that the drawn shape will be circular
  781.                     in modes without square pixels.
  782.      See also:      circle(), ellipse(), filledEllipse()
  783.  
  784.  *** Function:      fillRegion()
  785.      Syntax:        void fillRegion(int x, int y, unsigned colour);
  786.      Purpose:       Floods a region of the screen with the specified
  787.                     colour.
  788.      Parameters:    The fill will begin at the seed point ('x','y'), and
  789.                     will fill with the colour 'colour'.
  790.      Return value:  None.
  791.      Remarks:            The region to be filled is bounded by any colour
  792.                     not equal to the colour at ('x','y'); ie., the region
  793.                     to be filled consists of one colour only.
  794.                          Clipping is performed.
  795.      See also:      None.
  796.  
  797.  *** Function:      colourCloseTo()
  798.      Syntax:        unsigned colourCloseTo(unsigned char red, unsigned char
  799.                     green, unsigned char blue);
  800.      Purpose:       Given a 24-bit colour, find the colour from the current
  801.                     palette which most closely matches it.
  802.      Parameters:    The 24-bit colour is defined by the 'red', 'green', and
  803.                     'blue' parameters.
  804.      Return value:  Returns the colour which most closely matches the
  805.                     specified 24-bit colour.
  806.      Remarks:       None.
  807.      See also:      colourCloseToX()
  808.  
  809.  *** Function:      colourCloseToX()
  810.      Syntax:        unsigned colourCloseToX(unsigned char red, unsigned
  811.                     char green, unsigned char blue, unsigned
  812.                     colourExclude);
  813.      Purpose:       Given a 24-bit colour, find the colour from the current
  814.                     palette which most closely matches it, with the
  815.                     specified colour disallowed from the search.
  816.      Parameters:    The 24-bit colour is defined by the 'red', 'green', and
  817.                     'blue' parameters.  The colour 'colourExclude' is
  818.                     excluded from the search, and so will never be
  819.                     returned.
  820.      Return value:  Returns the colour which most closely matches the
  821.                     specified 24-bit colour.
  822.      Remarks:       Excluding zero from a search will ensure that the
  823.                     returned colour will be visible when it is used as part
  824.                     of a bitmap displayed using putImageInv().
  825.      See also:      colourCloseTo()
  826.  
  827.  
  828.      Note that since these function names are actually macros, they may
  829.      easily be changed to suit individual preferences by editing TGE.H.
  830.  
  831.  
  832.  
  833. VIEWPORTS AND CLIPPING
  834. flflflflflflflflflflflflflflflflflflflflflfl
  835.  
  836.      A viewport is a rectangular region on the screen to which output is
  837.      clipped, so that graphics output will appear only within that region.
  838.      By default, this region is the entire screen; however, it can be set
  839.      to any rectangular portion of the screen.  (Note that when a viewport
  840.      is in use, coordinates are absolute, not relative to the viewport.)
  841.  
  842.      TGE now supports two viewports simultaneously:  an input viewport and
  843.      an output viewport.  This feature was added primarily so that virtual
  844.      screens (see the VIRTUAL SCREENS section) and the real screen could be
  845.      used simultaneously, though it may have other uses as well.  The
  846.      following functions are used to get and set the current input and
  847.      output viewports:
  848.  
  849.  *** Function:      setInputViewport()
  850.      Syntax:        void setInputViewport(int ulx, int uly, int lrx, int lry);
  851.      Purpose:       Set the defining coordinates of the current input
  852.                     viewport.
  853.      Parameters:    The upper-left corner of the input viewport will be set to
  854.                     ('ulx','uly'), and the lower-right corner to
  855.                     ('lrx','lry').
  856.      Return value:  None.
  857.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  858.      See also:      setOutputViewport(), setViewports(),
  859.                     getInputViewport(), getOutputViewport()
  860.  
  861.  *** Function:      setOutputViewport()
  862.      Syntax:        void setOutputViewport(int ulx, int uly, int lrx, int lry);
  863.      Purpose:       Set the defining coordinates of the current output
  864.                     viewport.
  865.      Parameters:    The upper-left corner of the output viewport will be set
  866.                     to ('ulx','uly'), and the lower-right corner to
  867.                     ('lrx','lry').
  868.      Return value:  None.
  869.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  870.      See also:      setInputViewport(), setViewports(),
  871.                     getOutputViewport(), getInputViewport()
  872.  
  873.  *** Function:      setViewports()
  874.      Syntax:        void setViewports(int ulx, int uly, int lrx, int lry);
  875.      Purpose:       Set the defining coordinates of the current input and
  876.                     output viewports.
  877.      Parameters:    The upper-left corner of the viewports will be set to
  878.                     ('ulx','uly'), and the lower-right corner to
  879.                     ('lrx','lry').
  880.      Return value:  None.
  881.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  882.      See also:      setInputViewport(), setOutputViewport(),
  883.                     getInputViewport(), getOutputViewport()
  884.  
  885.  *** Function:      getInputViewport()
  886.      Syntax:        void getInputViewport(int *ulx, int *uly, int *lrx, int
  887.                     *lry);
  888.      Purpose:       Get the defining coordinates of the current input
  889.                     viewport.
  890.      Parameters:    The upper-left corner of the input viewport will be stored
  891.                     in ('ulx','uly'), and the lower-right corner in
  892.                     ('lrx','lry').
  893.      Return value:  None.
  894.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  895.      See also:      getOutputViewport(), setInputViewport(),
  896.                     setOutputViewport()
  897.  
  898.  *** Function:      getOutputViewport()
  899.      Syntax:        void getOutputViewport(int *ulx, int *uly, int *lrx, int
  900.                     *lry);
  901.      Purpose:       Get the defining coordinates of the current output
  902.                     viewport.
  903.      Parameters:    The upper-left corner of the output viewport will be
  904.                     stored in ('ulx','uly'), and the lower-right corner in
  905.                     ('lrx','lry').
  906.      Return value:  None.
  907.      Remarks:       It is assumed that 'ulx'<'lrx' and that 'uly'<'lry'.
  908.      See also:      setOutputViewport(), getInputViewport(),
  909.                     getOutputViewport()
  910.  
  911.  
  912.      Note that not all of TGE's functions will clip to within the current
  913.      output viewport.  Some of the time-critical graphics primitives, such
  914.      as putPixel() and line(), do not clip in order to improve execution
  915.      time.  If it is necessary for such functions to have their output
  916.      clipped, the following routines may be used:
  917.  
  918.  *** Function:      clipRect()
  919.      Syntax:        int clipRect(int *x1, int *y1, int *x2, int *y2);
  920.      Purpose:       Clip the given rectangle to within the current output
  921.                     viewport.
  922.      Parameters:    The upper-left and lower-right corners of the rectangle
  923.                     are passed in ('x1','y1') and ('x2','y2').  If clipping
  924.                     is done, these points will be modified.
  925.      Return value:  Returns true if the rectangle lies entirely or
  926.                     partially within the current output viewport, or false
  927.                     if it is entirely outside the current output viewport.
  928.      Remarks:            It does not matter which of the corner coordinates
  929.                     is passed first; they will be swapped if necessary.
  930.                          This function is contained in CLIP.C.
  931.  
  932.  *** Function:      clipLine()
  933.      Syntax:        int clipLine(int *x1, int *y1, int *x2, int *y2);
  934.      Purpose:       Clip the given line to within the current output
  935.                     viewport.
  936.      Parameters:    The endpoints of the line are passed in ('x1','y1') and
  937.                     ('x2','y2').  If clipping is done, these endpoints will
  938.                     be modified.
  939.      Return value:  Returns true if the line lies entirely or partially
  940.                     within the current output viewport, or false if it is
  941.                     entirely outside the current output viewport.
  942.      Remarks:       This function is contained in CLIP.C.
  943.      See also:      None.
  944.  
  945.  *** Function:      clipInputPoint()
  946.      Syntax:        int clipInputPoint(int x, int y);
  947.      Purpose:       Return a flag indicating whether or not the specified
  948.                     coordinates lie within the current input viewport.
  949.      Parameters:    The point ('x','y') is tested.
  950.      Return value:  Returns true if ('x','y') is within the current
  951.                     input viewport, or 0 if it isn't.
  952.      Remarks:       This function is really a macro defined in TGE.H.
  953.      See also:      None.
  954.  
  955.  *** Function:      clipOutputPoint()
  956.      Syntax:        int clipOutputPoint(int x, int y);
  957.      Purpose:       Return a flag indicating whether or not the specified
  958.                     coordinates lie within the current output viewport.
  959.      Parameters:    The point ('x','y') is tested.
  960.      Return value:  Returns true if ('x','y') is within the current
  961.                     output viewport, or 0 if it isn't.
  962.      Remarks:       This function is really a macro defined in TGE.H.
  963.      See also:      None.
  964.  
  965.  *** Function:      pointOnScreen()
  966.      Syntax:        int pointOnScreen(int x, int y);
  967.      Purpose:       Return a flag indicating whether or not the specified
  968.                     coordinates lie on-screen.
  969.      Parameters:    The point ('x','y') is tested.
  970.      Return value:  Returns true if ('x','y') is on-screen, or 0 if it is
  971.                     off-screen.
  972.      Remarks:       This function is really a macro defined in TGE.H.
  973.      See also:      None.
  974.  
  975.  
  976.      Note that since these function names are actually macros, they may
  977.      easily be changed to suit individual preferences by editing TGE.H.
  978.  
  979.  
  980.  
  981. VIRTUAL COORDINATES
  982. flflflflflflflflflflflflflflflflflflfl
  983.  
  984.      One of the problems associated with device-independence is that
  985.      different display modes have different resolutions.  TGE provides a
  986.      simple way to ease this problem, simply by #including VCOORD.H.  Doing
  987.      so provides access to a simple yet powerful object-oriented virtual
  988.      coordinate system.
  989.  
  990.      For the sake of illustration, assume that you are writing an
  991.      application which ideally will be run in resolutions as high as
  992.      1024x768, but can also be run in 320x200.  You want a way to have
  993.      objects (eg., windows) retain the same sizes and positions on-screen
  994.      in any graphics mode.  TGE's virtual coordinate system makes it easy.
  995.      First, create an instance of the virtual coordinate object (I'll call
  996.      the object virtScreen):
  997.  
  998.           VirtualCoord virtScreen;
  999.  
  1000.      Then, virtScreen must be configured; I'll assume that the virtual
  1001.      screen is to be 1024x768, and that OUTMAXX and OUTMAXY have been
  1002.      initialized by loading a driver.  (Note that these parameters may be
  1003.      set during the class instantiation by using a different constructor.)
  1004.  
  1005.           virtScreen.virtParams(1023, 767);
  1006.           virtScreen.realParams(OUTMAXX, OUTMAXY);
  1007.  
  1008.      As an example, assume that you want to draw a light gray rectangle
  1009.      with upper-left coordinates (50,50) and lower-right coordinates
  1010.      (600,600) on the virtual screen.  On, say, a 360x480 screen these
  1011.      values will be quite different; to keep the proportions the same,
  1012.      execute a line like the following:
  1013.  
  1014.           drawRect(virtScreen.realX(50), virtScreen.realY(50),
  1015.                    virtScreen.realX(600), virtScreen.realY(600),
  1016.                    colourCloseTo(200,200,200));
  1017.  
  1018.      That's all there is to it!  Keep in mind that there are other
  1019.      applications of the VirtualCoord class, aside from a virtual screen;
  1020.      it can also be useful when dealing with portions of the screen, scaled
  1021.      bitmaps, etc..
  1022.  
  1023.      A complete list of the VirtualCoord member functions follows.
  1024.  
  1025.  
  1026.  *** Function:      VirtualCoord::VirtualCoord()
  1027.      Syntax:        VirtualCoord::VirtualCoord(void);
  1028.      Purpose:       Create an instance of the VirtualCoord class.
  1029.      Parameters:    None.
  1030.      Return value:  None.
  1031.      Remarks:       After an instantiation of a VirtualCoord using this
  1032.                     constructor, ensure that the screen dimensions, both
  1033.                     virtual and real, are initialized using the method
  1034.                     illustrated above.
  1035.      See also:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  1036.                     unsigned, unsigned), VirtualCoord::virtParams(unsigned,
  1037.                     unsigned), VirtualCoord::realParams(unsigned, unsigned)
  1038.  
  1039.  *** Function:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  1040.                     unsigned, unsigned)
  1041.      Syntax:        VirtualCoord::VirtualCoord(unsigned virtMaxX, unsigned
  1042.                     virtMaxY, unsigned realMaxX, unsigned realMaxY);
  1043.      Purpose:       Create an instance of the VirtualCoord class, and
  1044.                     initialize it.
  1045.      Parameters:    The maximum virtual x-coordinate is set to 'virtMaxX',
  1046.                     and the y-coordinate to 'virtMaxY'.  The maximum real
  1047.                     x-coordinate is set to 'realMaxX', and the y-coordinate
  1048.                     to 'realMaxY'.
  1049.      Return value:  None.
  1050.      Remarks:       Be sure that a driver has been loaded before passing
  1051.                     OUTMAXX and OUTMAXY to this constructor.
  1052.      See also:      VirtualCoord::VirtualCoord(unsigned, unsigned,
  1053.                     unsigned, unsigned), VirtualCoord::virtParams(unsigned,
  1054.                     unsigned), VirtualCoord::realParams(unsigned, unsigned)
  1055.  
  1056.  *** Function:      VirtualCoord::virtParams(unsigned, unsigned)
  1057.      Syntax:        void VirtualCoord::virtParams(unsigned virtMaxX,
  1058.                     unsigned virtMaxY);
  1059.      Purpose:       Set the maximum virtual x- and y-coordinates.
  1060.      Parameters:    The maximum virtual x-coordinate is set to 'virtMaxX',
  1061.                     and the maximum y-coordinate to 'virtMaxY'.
  1062.      Return value:  None.
  1063.      Remarks:       None.
  1064.      See also:      VirtualCoord::realParams(unsigned, unsigned),
  1065.                     VirtualCoord::virtParams(unsigned*, unsigned*),
  1066.                     VirtualCoord::realParams(unsigned*, unsigned*)
  1067.  
  1068.  *** Function:      VirtualCoord::realParams(unsigned, unsigned)
  1069.      Syntax:        void VirtualCoord::realParams(unsigned virtMaxX,
  1070.                     unsigned virtMaxY);
  1071.      Purpose:       Set the maximum real x- and y-coordinates.
  1072.      Parameters:    The maximum real x-coordinate is set to 'realMaxX', and
  1073.                     the maximum y-coordinate to 'realMaxY'.
  1074.      Return value:  None.
  1075.      Remarks:       None.
  1076.      See also:      VirtualCoord::virtParams(unsigned, unsigned),
  1077.                     VirtualCoord::realParams(unsigned*, unsigned*),
  1078.                     VirtualCoord::virtParams(unsigned*, unsigned*)
  1079.  
  1080.  *** Function:      VirtualCoord::virtParams(unsigned*, unsigned*)
  1081.      Syntax:        void VirtualCoord::virtParams(unsigned *virtMaxX,
  1082.                     unsigned *virtMaxY);
  1083.      Purpose:       Get the maximum virtual x- and y-coordinates.
  1084.      Parameters:    The maximum virtual x-coordinate is stored in
  1085.                     'virtMaxX', and the maximum y-coordinate in 'virtMaxY'.
  1086.      Return value:  None.
  1087.      Remarks:       None.
  1088.      See also:      VirtualCoord::realParams(unsigned*, unsigned*),
  1089.                     VirtualCoord::virtParams(unsigned, unsigned),
  1090.                     VirtualCoord::realParams(unsigned, unsigned)
  1091.  
  1092.  *** Function:      VirtualCoord::realParams(unsigned*, unsigned*)
  1093.      Syntax:        void VirtualCoord::realParams(unsigned *virtMaxX,
  1094.                     unsigned *virtMaxY);
  1095.      Purpose:       Get the maximum real x- and y-coordinates.
  1096.      Parameters:    The maximum real x-coordinate is stored in 'realMaxX',
  1097.                     and the maximum y-coordinate in 'realMaxY'.
  1098.      Return value:  None.
  1099.      Remarks:       None.
  1100.      See also:      VirtualCoord::virtParams(unsigned*, unsigned*),
  1101.                     VirtualCoord::realParams(unsigned, unsigned),
  1102.                     VirtualCoord::virtParams(unsigned, unsigned)
  1103.  
  1104.  *** Function:      VirtualCoord::realCoords()
  1105.      Syntax:        void VirtualCoord::realCoords(unsigned virtX, unsigned
  1106.                     virtY, unsigned *realX, unsigned *realY);
  1107.      Purpose:       Calculate the real (x,y) coordinates given the virtual
  1108.                     coordinates.
  1109.      Parameters:    The real (x,y) coordinates are returned in
  1110.                     ('realX','realY'), and are calculated based on the
  1111.                     virtual (x,y) coordinates ('virtX','virtY').
  1112.      Return value:  None.
  1113.      Remarks:       None.
  1114.      See also:      VirtualCoord::realX(), VirtualCoord::realY(),
  1115.                     VirtualCoord::virtCoords(), VirtualCoord::virtX(),
  1116.                     VirtualCoord::virtY()
  1117.  
  1118.  *** Function:      VirtualCoord::realX()
  1119.      Syntax:        unsigned VirtualCoord::realX(unsigned virtX);
  1120.      Purpose:       Calculate the real x-coordinate given the virtual x-
  1121.                     coordinate.
  1122.      Parameters:    The real x-coordinate is returned, calculated based on
  1123.                     the virtual x-coordinate 'virtX'.
  1124.      Return value:  Returns the real x-coordinate.
  1125.      Remarks:       None.
  1126.      See also:      VirtualCoord::realY(), VirtualCoord::realCoords(),
  1127.                     VirtualCoord::virtX(), VirtualCoord::virtY(),
  1128.                     VirtualCoord::virtCoords()
  1129.  
  1130.  *** Function:      VirtualCoord::realY()
  1131.      Syntax:        unsigned VirtualCoord::realY(unsigned virtY);
  1132.      Purpose:       Calculate the real y-coordinate given the virtual y-
  1133.                     coordinate.
  1134.      Parameters:    The real y-coordinate is returned, calculated based on
  1135.                     the virtual y-coordinate 'virtY'.
  1136.      Return value:  Returns the real y-coordinate.
  1137.      Remarks:       None.
  1138.      See also:      VirtualCoord::realX(), VirtualCoord::realCoords(),
  1139.                     VirtualCoord::virtY(), VirtualCoord::virtX(),
  1140.                     VirtualCoord::virtCoords()
  1141.  
  1142.  *** Function:      VirtualCoord::virtCoords()
  1143.      Syntax:        void VirtualCoord::virtCoords(unsigned realX, unsigned
  1144.                     realY, unsigned *virtX, unsigned *virtY);
  1145.      Purpose:       Calculate the virtual (x,y) coordinates given the real
  1146.                     coordinates.
  1147.      Parameters:    The virtual (x,y) coordinates are returned in
  1148.                     ('virtX','virtY'), and are calculated based on the real
  1149.                     (x,y) coordinate ('realX','realY').
  1150.      Return value:  None.
  1151.      Remarks:       None.
  1152.      See also:      VirtualCoord::virtX(), VirtualCoord::virtY(),
  1153.                     VirtualCoord::realCoords(), VirtualCoord::realX(),
  1154.                     VirtualCoord::realY()
  1155.  
  1156.  *** Function:      VirtualCoord::virtX()
  1157.      Syntax:        unsigned VirtualCoord::virtX(unsigned realX);
  1158.      Purpose:       Calculate the virtual x-coordinate given the real x-
  1159.                     coordinate.
  1160.      Parameters:    The virtual x-coordinate is returned, calculated based
  1161.                     on the real x-coordinate 'realX'.
  1162.      Return value:  Returns the virtual x-coordinate.
  1163.      Remarks:       None.
  1164.      See also:      VirtualCoord::virtY(), VirtualCoord::virtCoords(),
  1165.                     VirtualCoord::realX(), VirtualCoord::realY(),
  1166.                     VirtualCoord::realCoords()
  1167.  
  1168.  *** Function:      VirtualCoord::virtY()
  1169.      Syntax:        unsigned VirtualCoord::virtY(unsigned realY);
  1170.      Purpose:       Calculate the virtual y-coordinate given the real y-
  1171.                     coordinate.
  1172.      Parameters:    The virtual y-coordinate is returned, calculated based
  1173.                     on the real y-coordinate 'realY'.
  1174.      Return value:  Returns the virtual y-coordinate.
  1175.      Remarks:       None.
  1176.      See also:      VirtualCoord::virtX(), VirtualCoord::virtCoords(),
  1177.                     VirtualCoord::realY(), VirtualCoord::realX(),
  1178.                     VirtualCoord::realCoords()
  1179.  
  1180.  
  1181.  
  1182. VIRTUAL SCREENS
  1183. flflflflflflflflflflflflflflfl
  1184.  
  1185.      In early releases of TGE, all graphics input and output operations
  1186.      were done on the screen.  Now four different I/O arrangements are
  1187.      available:
  1188.         - Input and output on the real screen.
  1189.         - Input and output on a virtual screen (ie. in memory).
  1190.         - Input from the real screen, and output to a virtual screen.
  1191.         - Input from a virtual screen, and output to the real screen.
  1192.      As well, it is possible to switch between these four I/O modes at any
  1193.      time with one or two simple function calls.
  1194.  
  1195.      Virtual screens are useful for such tasks as building complex images
  1196.      off-screen, then displaying them quickly.  Since a virtual screen has
  1197.      exactly the same format as the images used by getImage() and its
  1198.      associated functions, they can be displayed using a putImage() or
  1199.      putImageInv() call, simply by passing the address of the virtual
  1200.      screen as the address of the image to be displayed.
  1201.  
  1202.  
  1203.      A virtual screen (or any bitmap, for that matter) may be created using
  1204.      the following function:
  1205.  
  1206.  *** Function:      makeVirtScreen()
  1207.      Syntax:        void far *makeVirtScreen(unsigned wide, unsigned deep);
  1208.      Purpose:       Allocate enough RAM to store a virtual screen with the
  1209.                     specified dimensions, then initialize it.
  1210.      Parameters:    A virtual screen with width 'wide' and depth 'deep' (in
  1211.                     pixels) will be created.
  1212.      Return value:  Returns the address of the newly allocated virtual
  1213.                     screen, or NULL if there is not enough memory to create
  1214.                     it.
  1215.      Remarks:            Memory for the virtual screen is alloated from
  1216.                     available conventional memory; don't forget to
  1217.                     de-allocate (using farfree()) the memory occupied by a
  1218.                     virtual screen when the screen is no longer needed.
  1219.                          After it is allocated, a virtual screen will
  1220.                     likely be filled with random pixels.  Clearing it using
  1221.                     clearGraphics() is often a good idea (after graphics
  1222.                     output has been set to the virtual screen).
  1223.      See also:      None.
  1224.      
  1225.  
  1226.      The functions used to establish input and output to and from real and
  1227.      virtual screens are:
  1228.  
  1229.  *** Function:      setGraphicsAddr()
  1230.      Syntax:        void setGraphicsAddr(void far *addr);
  1231.      Purpose:       Set the location upon which graphics input and output
  1232.                     will both be performed.
  1233.      Parameters:    If 'addr' is equal to NULL, input and output will be
  1234.                     performed on the real screen; if 'addr' is non-NULL,
  1235.                     input and output will be performed on the virtual
  1236.                     screen pointed to by 'addr'.
  1237.      Return value:  None.
  1238.      Remarks:       This function sets the currently active input and
  1239.                     output viewports to cover the entirety of the virtual
  1240.                     screen.  INMAXX, INMAXY, OUTMAXX, and OUTMAXY are also
  1241.                     changed appropriately.
  1242.      See also:      setGraphicsInputAddr(), setGraphicsOutputAddr()
  1243.  
  1244.  *** Function:      setGraphicsInputAddr()
  1245.      Syntax:        void setGraphicsInputAddr(void far *addr);
  1246.      Purpose:       Set the location upon which graphics input will be
  1247.                     performed.
  1248.      Parameters:    If 'addr' is equal to NULL, input will be performed on
  1249.                     the real screen; if 'addr' is non-NULL, input will be
  1250.                     performed on the virtual screen pointed to by 'addr'.
  1251.      Return value:  None.
  1252.      Remarks:       This function sets the currently active input viewport
  1253.                     to cover the entirety of the virtual screen.  INMAXX
  1254.                     and INMAXY are also changed appropriately.
  1255.      See also:      setGraphicsOutputAddr(), setGraphicsAddr()
  1256.  
  1257.  *** Function:      setGraphicsOutputAddr()
  1258.      Syntax:        void setGraphicsOutputAddr(void far *addr);
  1259.      Purpose:       Set the location upon which graphics output will be
  1260.                     performed.
  1261.      Parameters:    If 'addr' is equal to NULL, output will be performed on
  1262.                     the real screen; if 'addr' is non-NULL, output will be
  1263.                     performed on the virtual screen pointed to by 'addr'.
  1264.      Return value:  None.
  1265.      Remarks:       This function sets the currently active output viewport
  1266.                     to cover the entirety of the virtual screen.  OUTMAXX
  1267.                     and OUTMAXY are also changed appropriately.
  1268.      See also:      setGraphicsInputAddr(), setGraphicsAddr()
  1269.  
  1270.  *** Function:      getGraphicsInputAddr()
  1271.      Syntax:        void far *getGraphicsInputAddr(void);
  1272.      Purpose:       Get the location upon which graphics input is currently
  1273.                     being performed.
  1274.      Parameters:    None.
  1275.      Return value:  Returns NULL if graphics input is currently being
  1276.                     performed on the physical screen, or the address of the
  1277.                     virtual screen upon which input is being performed
  1278.                     otherwise.
  1279.      Remarks:       None.
  1280.      See also:      getGraphicsOutputAddr()
  1281.  
  1282.  *** Function:      getGraphicsOutputAddr()
  1283.      Syntax:        void far *getGraphicsOutputAddr(void);
  1284.      Purpose:       Get the location upon which graphics output is currently
  1285.                     being performed.
  1286.      Parameters:    None.
  1287.      Return value:  Returns NULL if graphics output is currently being
  1288.                     performed on the physical screen, or the address of the
  1289.                     virtual screen upon which output is being performed
  1290.                     otherwise.
  1291.      Remarks:       None.
  1292.      See also:      getGraphicsInputAddr()
  1293.  
  1294.  
  1295.  
  1296. GRAPHICAL OUTPUT MODES
  1297. flflflflflflflflflflflflflflflflflflflflflfl
  1298.  
  1299.      In early releases of TGE, all graphics output was copied to the
  1300.      screen.  Now output can be copied, ANDed, NOTed, ORed, or XORed, even
  1301.      to virtual screens.  A description of each of these output modes
  1302.      follows:
  1303.         - COPY:  This mode is the one which will likely be used most
  1304.           frequently.  In this mode, any output is copied directly,
  1305.           overwriting anything which was previously there.
  1306.         - AND:  In this mode, each pixel output is ANDed with the pixel
  1307.           already at the same location.
  1308.         - NOT:  In this mode, each pixel output is NOTed before being
  1309.           output.
  1310.         - OR:  In this mode, each pixel output is ORed with the pixel
  1311.           already at the same location.
  1312.         - XOR:  In this mode, each pixel output is XORed with the pixel
  1313.           already at the same location.
  1314.  
  1315.  
  1316.      The following function allows selection of the output mode:
  1317.  
  1318.  *** Function:      setGraphicsOutputMode()
  1319.      Syntax:        void setGraphicsOutputMode(int mode);
  1320.      Purpose:       Select the currently used output mode.
  1321.      Parameters:    The output mode will be set to COPY if 'mode' is
  1322.                     TGE_COPY_PUT, AND if it is TGE_AND_PUT, NOT if it is
  1323.                     TGE_NOT_PUT, OR if it is TGE_OR_PUT, or XOR if it is
  1324.                     TGE_XOR_PUT.  These macros are defined in TGE.H.
  1325.      Return value:  None.
  1326.      Remarks:       These output modes affect output to physical and
  1327.                     virtual screens.
  1328.      See also:      None.
  1329.  
  1330.  
  1331.  
  1332. USING FONTS
  1333. flflflflflflflflflflfl
  1334.  
  1335.      TGE supports two types of loadable fonts:  fixed-size monochrome fonts
  1336.      (implemented with the FixedFont class), and variable-size 256-colour
  1337.      fonts (implemented with the VariableFont class).  Both high- and
  1338.      low-ASCII characters are supported.  As well, multiple fonts may be
  1339.      resident in memory simultaneously.
  1340.  
  1341.      For variable-size 256-colour fonts:
  1342.      ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
  1343.           Before attempting to use variable-size fonts, it is a good idea
  1344.           to understand exactly what it is that is variable.  Variable-size
  1345.           fonts DO NOT, at present, have the capability of scaling their
  1346.           member functions to arbitrary sizes.  What is meant by variable
  1347.           is that the character bitmaps themselves, while not resizable,
  1348.           are not all of the same size; eg., the letter 'm' is shorter and
  1349.           wider than the letter 'l', but neither can be resized.
  1350.  
  1351.           In order to use a variable-size 256-colour font, an instance of
  1352.           the VariableFont class is necessary.  Font initialization will
  1353.           look something like this:
  1354.  
  1355.                VariableFont systemFont;
  1356.                char systemFontName[] = "BIGTEXT";
  1357.                     .
  1358.                     .
  1359.                     .
  1360.                if (!systemFont.load(systemFontName))
  1361.                {
  1362.                  printf("Error loading %s; aborting.\n\n", systemFontName);
  1363.                  exit(EXIT_FAILURE);
  1364.                }
  1365.  
  1366.           Once a font has been loaded, it may be manipulated via its
  1367.           VariableFont class instance.  The class destructor automatically
  1368.           removes the font from memory.
  1369.  
  1370.           A complete list of the VariableFont member functions follows.
  1371.  
  1372.  
  1373.       *** Function:      VariableFont::load()
  1374.           Syntax:        int VariableFont::load(char *filename);
  1375.           Purpose:       Load a font from disk.
  1376.           Parameters:    The font file 'filename' will be loaded.
  1377.           Return value:  Returns 0 on error.
  1378.           Remarks:       None.
  1379.           See also:      None.
  1380.  
  1381.       *** Function:      VariableFont::put()
  1382.           Syntax:        void VariableFont::put(int x, int y, char
  1383.                          ch);
  1384.           Purpose:       Write a character on screen.
  1385.           Parameters:    The character 'ch' will be displayed with its
  1386.                          upper-left corner at ('x','y').
  1387.           Return value:  None.
  1388.           Remarks:       None.
  1389.           See also:      VariableFont::put(int, int, char*)
  1390.  
  1391.       *** Function:      VariableFont::put()
  1392.           Syntax:        void VariableFont::put(int x, int y, char
  1393.                          *string);
  1394.           Purpose:       Write a string on screen.
  1395.           Parameters:    The string 'string' will be displayed with its
  1396.                          upper-left corner at ('x','y').
  1397.           Return value:  None.
  1398.           Remarks:       None.
  1399.           See also:      VariableFont::put(int, int, char)
  1400.  
  1401.       *** Function:      VariableFont::width()
  1402.           Syntax:        unsigned VariableFont::width(char *string);
  1403.           Purpose:       Determine the width of a string.
  1404.           Parameters:    The width of the string 'string' will be
  1405.                          determined.
  1406.           Return value:  The width of the string, in pixels, will be
  1407.                          returned.
  1408.           Remarks:       None.
  1409.           See also:      VariableFont::width(char),
  1410.                          VariableFont::height(char*),
  1411.                          VariableFont::height(char)
  1412.  
  1413.       *** Function:      VariableFont::height()
  1414.           Syntax:        unsigned VariableFont::height(char *string);
  1415.           Purpose:       Determine the height of a string.
  1416.           Parameters:    The height of the string 'string' will be
  1417.                          determined.
  1418.           Return value:  The height of the string, in pixels, will be
  1419.                          returned.
  1420.           Remarks:       None.
  1421.           See also:      VariableFont::height(char),
  1422.                          VariableFont::width(char*),
  1423.                          VariableFont::width(char),
  1424.                          VariableFont::maxHeight()
  1425.  
  1426.       *** Function:      VariableFont::width()
  1427.           Syntax:        unsigned short VariableFont::width(char ch);
  1428.           Purpose:       Determine the width of a character.
  1429.           Parameters:    The width of the character 'ch' will be
  1430.                          determined.
  1431.           Return value:  The width of the string, in pixels, will be
  1432.                          returned.
  1433.           Remarks:       None.
  1434.           See also:      VariableFont::width(char*),
  1435.                          VariableFont::height(char),
  1436.                          VariableFont::width(char*)
  1437.  
  1438.       *** Function:      VariableFont::height()
  1439.           Syntax:        unsigned short VariableFont::height(char ch);
  1440.           Purpose:       Determine the height of a character.
  1441.           Parameters:    The height of the character 'ch' will be
  1442.                          determined.
  1443.           Return value:  The height of the string, in pixels, will be
  1444.                          returned.
  1445.           Remarks:       None.
  1446.           See also:      VariableFont::height(char*),
  1447.                          VariableFont::width(char),
  1448.                          VariableFont::height(char*),
  1449.                          VariableFont::maxHeight()
  1450.  
  1451.       *** Function:      VariableFont::maxHeight()
  1452.           Syntax:        unsigned short VariableFont::maxHeight(void);
  1453.           Purpose:       Determine the height of the tallest character.
  1454.           Parameters:    None.
  1455.           Return value:  The height of the tallest character, in pixels,
  1456.                          will be returned.
  1457.           Remarks:       None.
  1458.           See also:      VariableFont::height(char*),
  1459.                          VariableFont::height(char)
  1460.  
  1461.       *** Function:      VariableFont::matchColours()
  1462.           Syntax:        void VariableFont::matchColours(void);
  1463.           Purpose:       Match the font colours as closely as possible to
  1464.                          the currently selected font palette.
  1465.           Parameters:    None.
  1466.           Return value:  None.
  1467.           Remarks:       This function is really only useful after the
  1468.                          colour palette has been changed.
  1469.           See also:      VariableFont::palette(void*)
  1470.  
  1471.       *** Function:      VariableFont::palette(void*)
  1472.           Syntax:        void VariableFont::palette(void *palette);
  1473.           Purpose:       Change the currently active font palette.
  1474.           Parameters:    The currently active font palette will be set to
  1475.                          the palette at 'palette'.
  1476.           Return value:  None.
  1477.           Remarks:       VariableFont::matchColours() is autmatically
  1478.                          called by this function.
  1479.           See also:      VariableFont::palette(void),
  1480.                          VariableFont::palette(unsigned char, unsigned
  1481.                          char, unsigned char, unsigned char),
  1482.                          VariableFont::matchColours()
  1483.  
  1484.       *** Function:      VariableFont::palette(void)
  1485.           Syntax:        void *VariableFont::palette(void);
  1486.           Purpose:       Get the address of the currently active font
  1487.                          palette.
  1488.           Parameters:    None.
  1489.           Return value:  Returns the address of the font palette.
  1490.           Remarks:       If a change is made to this data directly, you
  1491.                          must call VariableFont::palette(void*) if the
  1492.                          changes are to take effect.
  1493.           See also:      VariableFont::palette(void),
  1494.                          VariableFont::palette(unsigned char, unsigned
  1495.                          char*, unsigned char*, unsigned char*)
  1496.  
  1497.       *** Function:      VariableFont::palette(unsigned char, unsigned
  1498.                          char, unsigned char, unsigned char)
  1499.           Syntax:        void VariableFont::palette(unsigned char palReg,
  1500.                          unsigned char red, unsigned char green, unsigned
  1501.                          char blue);
  1502.           Purpose:       Change one of the colours of the font palette.
  1503.           Parameters:    Colour number 'palReg' of the font palette will be
  1504.                          set to match the values passed in 'red', 'green',
  1505.                          and 'blue'.
  1506.           Return value:  None.
  1507.           Remarks:       The change will take effect immediately; there is
  1508.                          no need to explicitly update the palette.
  1509.           See also:      VariableFont::palette(void*)
  1510.  
  1511.       *** Function:      VariableFont::palette(unsigned char, unsigned
  1512.                          char*, unsigned char*, unsigned char*)
  1513.           Syntax:        void VariableFont::palette(unsigned char palReg,
  1514.                          unsigned char *red, unsigned char *green, unsigned
  1515.                          char *blue);
  1516.           Purpose:       Determine the contents of one of the colours of
  1517.                          the font palette.
  1518.           Parameters:    Colour number 'palReg' of the font palette will be
  1519.                          passed to the caller in 'red', 'green', and
  1520.                          'blue'.
  1521.           Return value:  None.  On return, however, the colour's components
  1522.                          will be present at the 'red', 'green', and 'blue'
  1523.                          buffers.
  1524.           Remarks:       None.
  1525.           See also:      VariableFont::palette(void)
  1526.  
  1527.       *** Function:      VariableFont::spacing()
  1528.           Syntax:        void VariableFont::spacing(unsigned numPixels);
  1529.           Purpose:       Change the spacing between characters.
  1530.           Parameters:    After calling this function, the number of pixels
  1531.                          left between characters output with
  1532.                          VariableFont::put(char*) will be set to
  1533.                          'numPixels'.
  1534.           Return value:  None.
  1535.           Remarks:       The spacing defaults to one pixel between each
  1536.                          character.
  1537.           See also:      VariableFont::spacing(void)
  1538.  
  1539.       *** Function:      VariableFont::spacing()
  1540.           Syntax:        unsigned VariableFont::spacing(void);
  1541.           Purpose:       Return the spacing between characters.
  1542.           Parameters:    None.
  1543.           Return value:  Returns the number of pixels used to space two
  1544.                          adjacent characters.
  1545.           Remarks:       The spacing defaults to one pixel between each
  1546.                          character.
  1547.           See also:      VariableFont::spacing(unsigned)
  1548.  
  1549.  
  1550.  
  1551.      For fixed-size monochrome fonts:
  1552.      ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
  1553.           In order to use a fixed-size monochrome font, an instance of the
  1554.           FixedFont class is necessary.  Assuming instantiation of a
  1555.           FixedFont pointer, font initialization will look something like
  1556.           this:
  1557.  
  1558.                FixedFont fixedFont;
  1559.                char fixedFontName[] = "8X16";
  1560.                          .
  1561.                          .
  1562.                          .
  1563.                if (!fixedFont.load(fixedFontName))
  1564.                {
  1565.                  printf("Error loading %s; aborting.\n\n", fixedFontName);
  1566.                  exit(EXIT_FAILURE);
  1567.                }
  1568.  
  1569.           Once a font has been loaded, it may be manipulated via its
  1570.           FixedFont class instance.  The class destructor automatically
  1571.           removes the font from memory.
  1572.  
  1573.           A complete list of the FixedFont member functions follows.
  1574.  
  1575.       *** Function:      FixedFont::FixedFont()
  1576.           Syntax:        FixedFont::FixedFont(unsigned char fg=1, unsigned
  1577.                          char bg=0);
  1578.           Purpose:       Initiate a FixedFont class for use with a font
  1579.                          which will be loaded later.
  1580.           Parameters:    'fg' (which defaults to 1) is the colour to be
  1581.                          used as the foreground colour.  'bg' (which
  1582.                          defaults to 0) is the colour to be used as the
  1583.                          background colour.
  1584.           Return value:  None.
  1585.           Remarks:       None.
  1586.           See also:      None.
  1587.  
  1588.       *** Function:      FixedFont::load()
  1589.           Syntax:        int FixedFont::load(char *filename);
  1590.           Purpose:       Load a font and prepare it for use.
  1591.           Parameters:    The font file 'filename' loaded.
  1592.           Return value:  Returns 0 on error.
  1593.           Remarks:       None.
  1594.           See also:      None.
  1595.  
  1596.       *** Function:      FixedFont::width(char*)
  1597.           Syntax:        unsigned FixedFont::width(char *str);
  1598.           Purpose:       Return the width, in pixels, of a string.
  1599.           Parameters:    The string 'str' is analyzed.
  1600.           Return value:  Returns the width of 'str', in pixels.
  1601.           Remarks:       None.
  1602.           See also:      FixedFont::width(char), FixedFont::height(char*),
  1603.                          FixedFont::height(char), FixedFont::maxWidth(),
  1604.                          FixedFont::maxHeight()
  1605.  
  1606.       *** Function:      FixedFont::width(char)
  1607.           Syntax:        unsigned FixedFont::width(char ch);
  1608.           Purpose:       Return the width, in pixels, of a single
  1609.                          character.
  1610.           Parameters:    The character 'ch' is analyzed.
  1611.           Return value:  Returns the width of 'ch', in pixels.
  1612.           Remarks:       None.
  1613.           See also:      FixedFont::width(char*), FixedFont::height(char),
  1614.                          FixedFont::height(char*), FixedFont::maxWidth(),
  1615.                          FixedFont::maxHeight()
  1616.  
  1617.       *** Function:      FixedFont::maxWidth()
  1618.           Syntax:        unsigned maxWidth(void);
  1619.           Purpose:       Return the width of the widest character.
  1620.           Parameters:    None.
  1621.           Return value:  Returns the width of the widest character.
  1622.           Remarks:       None.
  1623.           See also:      FixedFont::maxHeight(void),
  1624.                          FixedFont::width(char*), FixedFont::width(char),
  1625.                          FixedFont::height(char*), FixedFont::height(char)
  1626.  
  1627.       *** Function:      FixedFont::height(char*)
  1628.           Syntax:        unsigned FixedFont::height(char *str);
  1629.           Purpose:       Return the height, in pixels, of a string.
  1630.           Parameters:    The string 'str' is analyzed.
  1631.           Return value:  Returns the depth of 'str', in pixels.
  1632.           Remarks:       None.
  1633.           See also:      FixedFont::height(char), FixedFont::width(char*),
  1634.                          FixedFont::height(char), FixedFont::maxHeight(),
  1635.                          FixedFont::maxWidth()
  1636.  
  1637.       *** Function:      FixedFont::height(char)
  1638.           Syntax:        unsigned FixedFont::height(char ch);
  1639.           Purpose:       Return the height, in pixels, of a single
  1640.                          character.
  1641.           Parameters:    The character 'ch' is analyzed.
  1642.           Return value:  Returns the height of 'ch', in pixels.
  1643.           Remarks:       None.
  1644.           See also:      FixedFont::height(char*), FixedFont::width(char),
  1645.                          FixedFont::width(char*), FixedFont::maxWidth(),
  1646.                          FixedFont::maxHeight()
  1647.  
  1648.       *** Function:      FixedFont::maxHeight()
  1649.           Syntax:        unsigned maxHeight(void);
  1650.           Purpose:       Return the height of the tallest character.
  1651.           Parameters:    None.
  1652.           Return value:  Returns the height of the tallest character.
  1653.           Remarks:       None.
  1654.           See also:      FixedFont::maxWidth(void),
  1655.                          FixedFont::height(char*), FixedFont::height(char),
  1656.                          FixedFont::width(char*), FixedFont::width(char)
  1657.  
  1658.       *** Function:      FixedFont::put(int, int, char*)
  1659.           Syntax:        void FixedFont::put(int x, int y, char *str);
  1660.           Purpose:       Write a string to the screen.
  1661.           Parameters:    The string 'str' will be written starting at
  1662.                          ('x','y').
  1663.           Return value:  None.
  1664.           Remarks:       The coordinate passed to this function specifies
  1665.                          the upper-left coordinate of the string.
  1666.           See also:      FixedFont::put(char);
  1667.  
  1668.       *** Function:      FixedFont::put(int, int, char)
  1669.           Syntax:        void FixedFont::put(int x, int y, char ch);
  1670.           Purpose:       Write a single character to the screen.
  1671.           Parameters:    The character 'ch' will be written at
  1672.                          ('x','y').
  1673.           Return value:  None.
  1674.           Remarks:       The coordinate passed to this function specifies
  1675.                          the upper-left coordinate of the character.
  1676.           See also:      FixedFont::put(char*);
  1677.  
  1678.       *** Function:      FixedFont::foreground(unsigned)
  1679.           Syntax:        void FixedFont::foreground(unsigned colour);
  1680.           Purpose:       Set the current foreground colour.
  1681.           Parameters:    The foreground colour will be set to 'colour'.
  1682.           Return value:  None.
  1683.           Remarks:       None.
  1684.           See also:      FixedFont::background(unsigned),
  1685.                          FixedFont::foreground(void),
  1686.                          FixedFont::background(void)
  1687.  
  1688.       *** Function:      FixedFont::foreground(void)
  1689.           Syntax:        unsigned FixedFont::foreground(void);
  1690.           Purpose:       Return the current foreground colour.
  1691.           Parameters:    None.
  1692.           Return value:  Returns the current foreground colour.
  1693.           Remarks:       None.
  1694.           See also:      FixedFont::background(void),
  1695.                          FixedFont::foreground(unsigned),
  1696.                          FixedFont::foreground(unsigned)
  1697.  
  1698.       *** Function:      FixedFont::background(unsigned)
  1699.           Syntax:        void FixedFont::background(unsigned colour);
  1700.           Purpose:       Set the current background colour.
  1701.           Parameters:    The background colour will be set to 'colour'.
  1702.           Return value:  None.
  1703.           Remarks:       None.
  1704.           See also:      FixedFont::foreground(unsigned),
  1705.                          FixedFont::background(void),
  1706.                          FixedFont::foreground(void)
  1707.  
  1708.       *** Function:      FixedFont::background(void)
  1709.           Syntax:        unsigned FixedFont::background(void);
  1710.           Purpose:       Return the current background colour.
  1711.           Parameters:    None.
  1712.           Return value:  Returns the current background colour.
  1713.           Remarks:       None.
  1714.           See also:      FixedFont::foreground(void),
  1715.                          FixedFont::background(unsigned),
  1716.                          FixedFont::foreground(unsigned)
  1717.  
  1718.       *** Function:      FixedFont::charAddr(char)
  1719.           Syntax:        void *FixedFont::charAddr(char ch);
  1720.           Purpose:       Return the address of the first byte of the
  1721.                          specified character's bitimage.
  1722.           Parameters:    The character 'ch' will have its address
  1723.                          calculated.
  1724.           Return value:  Returns the address of 'ch''s bitimage.
  1725.           Remarks:       None.
  1726.           See also:      None.
  1727.  
  1728.  
  1729.      Note that, at present, TGE's fonts are designed for use in 256-colour
  1730.      modes only.
  1731.  
  1732.  
  1733.  
  1734. BITMAP MANIPULATION
  1735. flflflflflflflflflflflflflflflflflflfl
  1736.  
  1737.      Bitmaps can get boring when all you can do is display them.  TGE can
  1738.      scale bitmaps to different sizes, using the following function:
  1739.  
  1740.  *** Function:      scaleBitmap()
  1741.      Syntax:        void far *scaleBitmap(void *srcImage, unsigned newWide,
  1742.                     unsigned newDeep, void *destImage)
  1743.      Purpose:       Scale the given bitmap to the specified size.
  1744.      Parameters:    The image in 'srcImage' will be scaled to 'newWide'
  1745.                     pixels wide and 'newDeep' pixels deep.  The resulting
  1746.                     scaled image will be placed in 'destImage' if
  1747.                     'destImage' is non-NULL, or in a newly allocated block
  1748.                     of memory if 'destImage' is NULL.
  1749.      Return value:  Returns the address of the scaled image on success, or
  1750.                     NULL on error.  Note that NULL will never be returned
  1751.                     if 'destImage' is non-NULL.
  1752.      Remarks:       Results are undefined if either 'newWide' or 'newDeep'
  1753.                     is equal to zero.
  1754.      See also:      None.
  1755.  
  1756.  
  1757.      TGE also provides routines for determining an image's dimensions given
  1758.      its address:
  1759.  
  1760.  *** Function:      imageWidth
  1761.      Syntax:        unsigned imageWidth(void *image);
  1762.      Purpose:       Determine an image's width.
  1763.      Parameters:    This routine will determine the width of 'image'.
  1764.      Return value:  Returns the width, in pixels, of 'image'.
  1765.      Remarks:       This routine is implemented as a macro in TGE.H.
  1766.      See also:      imageHeight
  1767.  
  1768.  *** Function:      imageHeight
  1769.      Syntax:        unsigned imageHeight(void *image);
  1770.      Purpose:       Determine an image's height.
  1771.      Parameters:    This routine will determine the height of 'image'.
  1772.      Return value:  Returns the height, in pixels, of 'image'.
  1773.      Remarks:       This routine is implemented as a macro in TGE.H.
  1774.      See also:      imageWidth
  1775.  
  1776.  
  1777.  
  1778. PALETTE MANIPULATION
  1779. flflflflflflflflflflflflflflflflflflflfl
  1780.  
  1781.      TGE provides some palette manipulation routines, described below:
  1782.  
  1783.  
  1784.  *** Function:      fadePalette
  1785.      Syntax:        int fadePalette(unsigned step, void *inPal, void
  1786.                     *outPal, void *targetPal);
  1787.      Purpose:       Fade one palette into another.
  1788.      Parameters:    The palette at 'inPal' will be faded closer to the
  1789.                     palette at 'targetPal'.  The resulting palette will be
  1790.                     stored at 'outPal'.  Each of the colour components
  1791.                     which compose a palette colour will be incremented or
  1792.                     decremented by no more than the value in 'step'; thus,
  1793.                     higher 'step' values produce more rapid fading.
  1794.      Return value:  Returns 0 if fading is complete, or 1 if it isn't.
  1795.      Remarks:       Note that this function does not always complete the
  1796.                     fading with one call.  Code like this could be used:
  1797.                          while (fadePalette(1, in, out, target))
  1798.                          {
  1799.                            delay(10);
  1800.                            setBlockPalette(0, 255, out);
  1801.                            swap(in, out);
  1802.                            doSomeOtherProcessing();
  1803.                          }
  1804.      See also:      None.
  1805.  
  1806.  *** Function:      greyPalette
  1807.      Syntax:        void greyPalette(void *inPal, void *outPal);
  1808.      Purpose:       Produce a greyscale version of a palette.
  1809.      Parameters:    A greyscale version of the palette at 'inPal' will be
  1810.                     calculated, and stored at 'outPal'.
  1811.      Return value:  None, but the calculated greyscale palette will be at
  1812.                     'outPal' on return.
  1813.      Remarks:       Images designed with the input palette in mind will
  1814.                     look the same under the output greyscale palette,
  1815.                     except that they will be composed entirely of greys,
  1816.                     black, and white.
  1817.      See also:      None.
  1818.  
  1819.  *** Function:      rotatePalette
  1820.      Syntax:        void rotatePalette(int howMuch, void *inPal, void
  1821.                     *outPal)
  1822.      Purpose:       Rotate a palette.
  1823.      Parameters:    The palette at 'inPal' will be rotated by the value
  1824.                     'howMuch', and the resulting palette will be placed at
  1825.                     'outPal'.  'howMuch' can be negative or positive,
  1826.                     depending on which direction rotation will be
  1827.                     performed; for instance, a 'howMuch' value of 1 would
  1828.                     cause the value of colour 0 to move to colour 1, while
  1829.                     a 'howMuch' value of -1 would have the opposite effect.
  1830.      Return value:  None, but the rotated palette will be at 'outPal' on
  1831.                     return.
  1832.      Remarks:       This function will still operate correctly with
  1833.                     'howMuch' values which are greater than 255 or less
  1834.                     than -255.
  1835.      See also:      None.
  1836.  
  1837.  *** Function:      promotePalette
  1838.      Syntax:        void promotePalette(void *pal);
  1839.      Purpose:       Promote a 6-bit palette to 8-bit.
  1840.      Parameters:    The palette at 'pal' will be promoted.
  1841.      Return value:  None, but the promoted palette will be at 'pal' on
  1842.                     return.
  1843.      Remarks:       Some palettes are saved in 6-bit format, which uses
  1844.                     colour component values of 0..63; other programs, TGE
  1845.                     among them, use 8-bit format, which uses colour
  1846.                     component values of 0..255.  This function makes it
  1847.                     easy to use 6-bit palettes with TGE.
  1848.      See also:      demotePalette()
  1849.  
  1850.  *** Function:      demotePalette
  1851.      Syntax:        void demotePalette(void *pal);
  1852.      Purpose:       Demote an 8-bit palette to 6-bit.
  1853.      Parameters:    The palette at 'pal' will be demoted.
  1854.      Return value:  None, but the demoted palette will be at 'pal' on
  1855.                     return.
  1856.      Remarks:       Some palettes are saved in 6-bit format, which uses
  1857.                     colour component values of 0..63; other programs, TGE
  1858.                     among them, use 8-bit format, which uses colour
  1859.                     component values of 0..255.  This function makes it
  1860.                     easy to use 6-bit palettes with TGE.
  1861.      See also:      promotePalette()
  1862.  
  1863.  *** Function:      replaceColour
  1864.      Syntax:        void replaceColour(int ulx, int uly, int lrx, int lry,
  1865.                     unsigned oldColour, unsigned newColour);
  1866.      Purpose:       Replace all instances of a given colour within a
  1867.                     specified region.
  1868.      Parameters:    All instances of the colour 'oldColour' within the
  1869.                     rectangular region with upper-left corner ('ulx','uly')
  1870.                     and lower-right corner ('lrx','lry') will be replaced
  1871.                     with the colour 'newColour'.
  1872.      Return value:  None.
  1873.      Remarks:            Results are undefined if any coordinate of the
  1874.                     region is off-screen.
  1875.                          This function does not clip to within either
  1876.                     viewport.
  1877.                          This function does not actually change the
  1878.                     palette, but rather the pixel values themselves.
  1879.      See also:      None.
  1880.  
  1881.  
  1882.  
  1883. USING THE MOUSE
  1884. flflflflflflflflflflflflflflfl
  1885.  
  1886.      TGE now provides support for interrupt-driven, definable mouse
  1887.      pointers.  In order to make use of this feature, some simple steps
  1888.      must be taken.
  1889.  
  1890.      The new mouse handler is designed to work in tandem with TGE's
  1891.      graphical functions.  Programs using the new mouse handler must first
  1892.      have successfully initialized graphics mode using TGE.  Both TGE.H and
  1893.      TGEMOUSE.H must be #included into a program using the mouse services.
  1894.  
  1895.      The mouse handler has to be initialized.  To do so, one function call
  1896.      is required:
  1897.  
  1898.           initNewMouse();
  1899.  
  1900.      For more information on initNewMouse(), refer to the mouse functions
  1901.      reference section.
  1902.  
  1903.      Next, the mouse driver must be informed of the screen dimensions, like
  1904.      this:
  1905.  
  1906.           setHorizLimitsMouse(0, OUTMAXX);
  1907.           setVertLimitsMouse(0, OUTMAXY);
  1908.  
  1909.      If desired, the pointer may then be positioned.  To center it on the
  1910.      screen, do this:
  1911.  
  1912.           setPosMouse(OUTMAXX/2, OUTMAXY/2);
  1913.  
  1914.      A pointer shape must then be selected.  TGE, as shipped, includes two
  1915.      arrow pointers and two target pointers; the file MOUSEPTR.C may easily
  1916.      be modified to allow more.  To select, for instance, the big arrow
  1917.      pointer, do this:
  1918.  
  1919.           setupMousePointer(BIG_ARROW_POINTER);
  1920.  
  1921.      The macro BIG_ARROW_POINTER is defined in TGEMOUSE.H; it expands to a
  1922.      number which is used by MOUSEPTR.C to identify which bitmap to use.
  1923.      Note that if exceptionally large (ie. larger than 512 bytes) pointers
  1924.      are used, a change must be made in NEWMOUSE.ASM; see that file for
  1925.      details.  If you would like to directly set a particular bitmap as the
  1926.      mouse pointer, you may use setPointerMouse(), described in the next
  1927.      section.
  1928.  
  1929.      Once things have been initialized, the use of the new mouse handler
  1930.      over the standard mouse driver can essentially be ignored; mouse
  1931.      driver services are obtained in exactly the same way.  The mouse
  1932.      interface functions are prototyped in TGEMOUSE.H, also using the macro
  1933.      method which allows function names to be changed simply by editing
  1934.      TGEMOUSE.H.
  1935.  
  1936.      Before exiting the program, the function deInitNewMouse() _must_ be
  1937.      called.  It is usually a very good idea to place deInitNewMouse() in
  1938.      the atexit() queue immediately after calling initNewMouse().
  1939.  
  1940.      Note that, since the pointer is drawn using TGE's putImageInv()
  1941.      function, the pointer will only appear when it is within the current
  1942.      viewport.
  1943.  
  1944.  
  1945.  
  1946. TGE'S MOUSE FUNCTION SET
  1947. flflflflflflflflflflflflflflflflflflflflflflflfl
  1948.  
  1949.  *** Function:      initNewMouse()
  1950.      Syntax:        void initNewMouse(void);
  1951.      Purpose:       Initializes the new mouse handler.
  1952.      Parameters:    The new mouse handler will be configured for use with
  1953.                     TGE.
  1954.      Return value:  None.
  1955.      Remarks:            A graphics driver must have been loaded prior to a
  1956.                     call to initNewMouse().
  1957.                          The new mouse handler requires that a Microsoft or
  1958.                     compatible mouse driver already be resident.  It
  1959.                     assumes that a mouse driver's presence will have been
  1960.                     tested beforehand.
  1961.                          initNewMouse() is really a simple macro; refer to
  1962.                     TGEMOUSE.H for the expansion of initNewMouse(void);
  1963.      See also:      deInitNewMouse(), enableNewMouse(), disableNewMouse()
  1964.  
  1965.  *** Function:      deInitNewMouse()
  1966.      Syntax:        void deInitNewMouse(void);
  1967.      Purpose:       Deactivate the new mouse handler, and leave all the
  1968.                     work up to the old driver.
  1969.      Parameters:    None.
  1970.      Return value:  None.
  1971.      Remarks:       This function must be called prior to program exit if
  1972.                     initNewMouse() had previously been called.
  1973.      See also:      initNewMouse(), enableNewMouse(), disableNewMouse()
  1974.  
  1975.  *** Function:      enableNewMouse()
  1976.      Syntax:        void enableNewMouse(void);
  1977.      Purpose:       Reactivate the new mouse handler following a call to
  1978.                     disableNewMouse().
  1979.      Parameters:    None.
  1980.      Return value:  None.
  1981.      Remarks:       None.
  1982.      See also:      disableNewMouse(), initNewMouse(), deInitNewMouse()
  1983.  
  1984.  *** Function:      disableNewMouse()
  1985.      Syntax:        void disableNewMouse(void);
  1986.      Purpose:       Temporarily deactivate the new mouse handler, to be
  1987.                     reactivated later by a call to enableNewMouse().
  1988.      Parameters:    None.
  1989.      Return value:  None.
  1990.      Remarks:       Following a call to this function, the new mouse
  1991.                     handler will cease trapping mouse driver interrupts and
  1992.                     moving the pointer.
  1993.      See also:      enableNewMouse(), initNewMouse(), deInitNewMouse()
  1994.  
  1995.  *** Function:      resetMouse()
  1996.      Syntax:        int resetMouse(void);
  1997.      Purpose:       Reset the mouse driver and hardware.
  1998.      Parameters:    None.
  1999.      Return value:  1 if mouse driver available, 0 otherwise.
  2000.      Remarks:       Following a call to this function, the mouse pointer is
  2001.                     hidden and positioned at the center of the screen.
  2002.      See also:      softResetMouse(), initNewMouse()
  2003.  
  2004.  *** Function:      getButtonsMouse()
  2005.      Syntax:        int getButtonsMouse(void);
  2006.      Purpose:       Return the number of buttons on the mouse.
  2007.      Parameters:    None.
  2008.      Return value:  Returns the number of buttons on the mouse.
  2009.      Remarks:       This function calls resetMouse(), and so the mouse
  2010.                     driver and hardware are re-initialized.
  2011.      See also:      resetMouse()
  2012.  
  2013.  *** Function:      showMouse()
  2014.      Syntax:        void showMouse(void);
  2015.      Purpose:       Show the mouse pointer.
  2016.      Parameters:    None.
  2017.      Return value:  None.
  2018.      Remarks:       Calls to showMouse() and hideMouse() are cumulative;
  2019.                     ie., if showMouse() is called twice, hideMouse() must
  2020.                     be called twice to hide the pointer again.
  2021.      See also:      hideMouse()
  2022.  
  2023.  *** Function:      hideMouse()
  2024.      Syntax:        void hideMouse(void);
  2025.      Purpose:       Hide the mouse pointer.
  2026.      Parameters:    None.
  2027.      Return value:  None.
  2028.      Remarks:       Calls to showMouse() and hideMouse() are cumulative;
  2029.                     ie., if showMouse() is called twice, hideMouse() must
  2030.                     be called twice to hide the pointer again.
  2031.      See also:      showMouse()
  2032.  
  2033.  *** Function:      getPosMouse()
  2034.      Syntax:        void getPosMouse(int far *x, int far *y);
  2035.      Purpose:       Get the current pointer coordinates.
  2036.      Parameters:    The current pointer x- and y-coordinates will be stored
  2037.                     in 'x' and 'y', respectively.
  2038.      Return value:  None.
  2039.      Remarks:       None.
  2040.      See also:      setPosMouse()
  2041.  
  2042.  *** Function:      setPosMouse()
  2043.      Syntax:        void setPosMouse(unsigned x, unsigned y);
  2044.      Purpose:       Set the current pointer coordinates.
  2045.      Parameters:    The pointer will be positioned at ('x','y').
  2046.      Return value:  None.
  2047.      Remarks:       None.
  2048.      See also:      getPosMouse()
  2049.  
  2050.  *** Function:      buttonMouse()
  2051.      Syntax:        int buttonMouse(void);
  2052.      Purpose:       Return whether or not any of the mouse buttons is down.
  2053.      Parameters:    None.
  2054.      Return value:  Returns true if at least one button is down, or zero if
  2055.                     none of them is down.
  2056.      Remarks:       None.
  2057.      See also:      leftButtonMouse(), rightButtonMouse(),
  2058.                     centerButtonMouse(), waitReleaseMouse()
  2059.  
  2060.  *** Function:      leftButtonMouse()
  2061.      Syntax:        int leftButtonMouse(void);
  2062.      Purpose:       Return the status of the left mouse button.
  2063.      Parameters:    None.
  2064.      Return value:  Returns true if the button is down, or zero if it is
  2065.                     up.
  2066.      Remarks:       None.
  2067.      See also:      buttonMouse(), rightButtonMouse(), centerButtonMouse(),
  2068.                     waitReleaseMouse()
  2069.  
  2070.  *** Function:      rightButtonMouse()
  2071.      Syntax:        int rightButtonMouse(void);
  2072.      Purpose:       Return the status of the right mouse button.
  2073.      Parameters:    None.
  2074.      Return value:  Returns true if the button is down, or zero if it is
  2075.                     up.
  2076.      Remarks:       None.
  2077.      See also:      buttonMouse(), leftButtonMouse(), centerButtonMouse(),
  2078.                     waitReleaseMouse()
  2079.  
  2080.  *** Function:      centerButtonMouse()
  2081.      Syntax:        int centerButtonMouse(void);
  2082.      Purpose:       Return the status of the center mouse button.
  2083.      Parameters:    None.
  2084.      Return value:  Returns true if the button is down, or zero if it is
  2085.                     up.
  2086.      Remarks:       None.
  2087.      See also:      buttonMouse(), leftButtonMouse(), rightButtonMouse(),
  2088.                     waitReleaseMouse()
  2089.  
  2090.  *** Function:      buttonPressMouse()
  2091.      Syntax:        unsigned buttonPressMouse(unsigned button, int far *x,
  2092.                     int far *y);
  2093.      Purpose:       Return the number of times the specified button has
  2094.                     been pressed since the last call to this function (with
  2095.                     the same button parameter), and store the coordinates
  2096.                     of the last press.
  2097.      Parameters:    The button 'button' is checked, and may be any of
  2098.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  2099.                     defined in TGEMOUSE.H.  The position of the last press
  2100.                     will be stored in ('x','y').
  2101.      Return value:  Returns the number of times the specified button has
  2102.                     been pressed since the last call to this function (with
  2103.                     the same button parameter).
  2104.      Remarks:       None.
  2105.      See also:      buttonReleaseMouse()
  2106.  
  2107.  *** Function:      buttonReleaseMouse()
  2108.      Syntax:        unsigned buttonReleaseMouse(unsigned button, int far
  2109.                     *x, int far *y);
  2110.      Purpose:       Return the number of times the specified button has
  2111.                     been released since the last call to this function
  2112.                     (with the same button parameter), and store the
  2113.                     coordinates of the last press.
  2114.      Parameters:    The button 'button' is checked, and may be any of
  2115.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  2116.                     defined in TGEMOUSE.H.  The position of the last
  2117.                     release will be stored in ('x','y').
  2118.      Return value:  Returns the number of times the specified button has
  2119.                     been released since the last call to this function
  2120.                     (with the same button parameter).
  2121.      Remarks:       None.
  2122.      See also:      buttonPressMouse()
  2123.  
  2124.  *** Function:      waitReleaseMouse()
  2125.      Syntax:        void waitReleaseMouse(int button);
  2126.      Purpose:       If the specified button is not already up, wait until
  2127.                     it is released, then return.
  2128.      Parameters:    The button 'button' is checked, and may be any of
  2129.                     LEFTBUTTON, RIGHTBUTTON, and CENTERBUTTON, which are
  2130.                     defined in TGEMOUSE.H.
  2131.      Return value:  None.
  2132.      Remarks:       None.
  2133.      See also:      buttonMouse(), leftButtonMouse(), rightButtonMouse(),
  2134.                     centerButtonMouse()
  2135.  
  2136.  *** Function:      setHorizLimitsMouse()
  2137.      Syntax:        void setHorizLimitsMouse(unsigned min, unsigned max);
  2138.      Purpose:       Set the minimum and maximum horizontal coordinates for
  2139.                     the pointer.
  2140.      Parameters:    The minimum horizontal coordinate will be set to 'min',
  2141.                     and the maximum to 'max'.
  2142.      Return value:  None.
  2143.      Remarks:       None.
  2144.      See also:      setVertLimitsMouse()
  2145.  
  2146.  *** Function:      setVertLimitsMouse()
  2147.      Syntax:        void setVertLimitsMouse(unsigned min, unsigned max);
  2148.      Purpose:       Set the minimum and maximum vertical coordinates for
  2149.                     the pointer.
  2150.      Parameters:    The minimum vertical coordinate will be set to 'min',
  2151.                     and the maximum to 'max'.
  2152.      Return value:  None.
  2153.      Remarks:       None.
  2154.      See also:      setHorizLimitsMouse()
  2155.  
  2156.  *** Function:      setPointerMouse()
  2157.      Syntax:        void setPointerMouse(int xOff, int yOff, void far *p);
  2158.      Purpose:       Set the shape of the pointer.
  2159.      Parameters:    The image pointed to by 'p' will be the pointer bitmap. 
  2160.                     ('xOff','yOff') is the offset, relative to the upper-
  2161.                     left corner of the bitmap, of the "hot spot" -- the
  2162.                     pixel where the pointer is actually registered as
  2163.                     being.  (For instance, the standard arrow pointer has
  2164.                     its hot spot in the upper-left, while a crosshairs
  2165.                     pointer would have it towards the middle.)
  2166.      Return value:  None.
  2167.      Remarks:       The mouse pointer should be hidden when a call to this
  2168.                     function is made.
  2169.      See also:      None.
  2170.  
  2171.  *** Function:      getSaveSizeMouse()
  2172.      Syntax:        unsigned getSaveSizeMouse(void);
  2173.      Purpose:       Return the size of the buffer necessary to store the
  2174.                     state of the mouse driver.
  2175.      Parameters:    None.
  2176.      Return value:  Returns the size of the buffer.
  2177.      Remarks:       If a program using TGE and the new mouse handling
  2178.                     routines is to run another program, for instance
  2179.                     shelling to DOS, the ensuing procedure should be
  2180.                     followed:  call disableNewMouse(), call
  2181.                     getSaveSizeMouse(), allocate a block of memory with the
  2182.                     size returned by getSaveSizeMouse(), call
  2183.                     saveStateMouse(), run the program, call
  2184.                     restoreStateMouse(), free the block of memory, then
  2185.                     call enableNewMouse().
  2186.      See also:      saveStateMouse(), restoreStateMouse()
  2187.  
  2188.  *** Function:      saveStateMouse()
  2189.      Syntax:        void saveStateMouse(void far *buf);
  2190.      Purpose:       Save the current state of the mouse driver.
  2191.      Parameters:    The block of memory pointed to by 'buf' will be used to
  2192.                     store the state data.  Its length should be obtained by
  2193.                     calling getSaveSizeMouse().
  2194.      Return value:  None.
  2195.      Remarks:       If a program using TGE and the new mouse handling
  2196.                     routines is to run another program, for instance
  2197.                     shelling to DOS, the ensuing procedure should be
  2198.                     followed:  call disableNewMouse(), call
  2199.                     getSaveSizeMouse(), allocate a block of memory with the
  2200.                     size returned by getSaveSizeMouse(), call
  2201.                     saveStateMouse(), run the program, call
  2202.                     restoreStateMouse(), free the block of memory, then
  2203.                     call enableNewMouse().
  2204.      See also:      getSaveSizeMouse(), restoreStateMouse()
  2205.  
  2206.  *** Function:      restoreStateMouse()
  2207.      Syntax:        void restoreStateMouse(void far *buf);
  2208.      Purpose:       Restore the state of the mouse driver from a buffer
  2209.                     previously filled by saveStateMouse().
  2210.      Parameters:    The block of memory pointed to by 'buf' stores the
  2211.                     state data.
  2212.      Return value:  None.
  2213.      Remarks:       If a program using TGE and the new mouse handling
  2214.                     routines is to run another program, for instance
  2215.                     shelling to DOS, the ensuing procedure should be
  2216.                     followed:  call disableNewMouse(), call
  2217.                     getSaveSizeMouse(), allocate a block of memory with the
  2218.                     size returned by getSaveSizeMouse(), call
  2219.                     saveStateMouse(), run the program, call
  2220.                     restoreStateMouse(), free the block of memory, then
  2221.                     call enableNewMouse().
  2222.      See also:      getSaveSizeMouse, saveStateMouse
  2223.  
  2224.  *** Function:      setRatioMouse()
  2225.      Syntax:        void setRatioMouse(unsigned horiz, unsigned vert);
  2226.      Purpose:       Set the mouse sensitivity, in units of mickeys per 8
  2227.                     pixels of pointer movement.  (A mickey is the unit used
  2228.                     to measure mouse movement.)
  2229.      Parameters:    The horizontal mickeys to pixels ratio will be set to
  2230.                     'horiz', and the vertical to 'vert'.
  2231.      Return value:  None.
  2232.      Remarks:       None.
  2233.      See also:      getSensitivityMouse()
  2234.  
  2235.  *** Function:      getSensitivityMouse()
  2236.      Syntax:        void getSensitivityMouse(unsigned *horiz, unsigned
  2237.                     *vert, unsigned *doubleSpeed);
  2238.      Purpose:       Get the mouse sensitivity, in units of mickeys per 8
  2239.                     pixels of pointer movement.  (A mickey is the unit used
  2240.                     to measure mouse movement.)  The mouse double speed
  2241.                     threshold (the minimum number of mickeys per second of
  2242.                     motion before pointer movement is doubled) is retrieved
  2243.                     as well.
  2244.      Parameters:    The horizontal mickeys to pixels ratio will be stored
  2245.                     in 'horiz', the vertical in 'vert', and the double
  2246.                     speed threshold in 'doubleSpeed'.
  2247.      Return value:  None.
  2248.      Remarks:       None.
  2249.      See also:      setRatioMouse()
  2250.  
  2251.  *** Function:      softResetMouse()
  2252.      Syntax:        void softResetMouse(void);
  2253.      Purpose:       Reset the mouse driver, but not the hardware.
  2254.      Parameters:    None.
  2255.      Return value:  None.
  2256.      Remarks:       This function is equivalent to resetMouse(), except in
  2257.                     that it performs no initialization of the mouse
  2258.                     hardware.
  2259.      See also:      resetMouse()
  2260.  
  2261.  
  2262.      Note that since these function names are actually macros, they may
  2263.      easily be changed to suit individual preferences by editing
  2264.      TGEMOUSE.H.
  2265.  
  2266.  
  2267.  
  2268. ADDITIONAL FEATURES IN THE REGISTERED VERSION
  2269. flflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflfl
  2270.  
  2271.      In addition to technical support and usage rights, registered users
  2272.      may use the registered version of TGE.  Not only does the registered
  2273.      version of TGE include complete source code for the TGE library and an
  2274.      extra font not found in the shareware version, it also includes some
  2275.      features not available in the shareware verion:
  2276.  
  2277.      Registered users can save up to about 22 kb of memory by selectively
  2278.      commenting out #defines in TGE.H and compiling the TGE library.
  2279.      Following is a list of symbols and the features they disable when
  2280.      they're not #defined:
  2281.           TGE_USE_VIRTUAL_SCREENS       Virtual screen support.
  2282.           TGE_USE_OUTPUT_MODES          Output mode support.
  2283.           TGE_USE_REGION_FILLS          fillRegion().
  2284.           TGE_USE_IMAGES                Bitmap-related functions.
  2285.           TGE_USE_ELLIPSES              ellipse- and circle-drawing.
  2286.           TGE_USE_COLOUR_APPROXIMATION  colourCloseTo() and
  2287.                                         colourCloseToX().
  2288.           TGE_USE_LOADGRAPHDRIVER       loadGraphDriver() and
  2289.                                         unloadGraphDriver().
  2290.      The source for the disabled features is simply not compiled, and so
  2291.      does not waste space in the executable or in memory.  Remember to
  2292.      recompile the TGE library after making a change!
  2293.  
  2294.  
  2295.  
  2296. CREATING FONTS
  2297. flflflflflflflflflflflflflfl
  2298.  
  2299.      Creating fonts is not easy, but the necessary information is outlined
  2300.      below.
  2301.  
  2302.      For variable-size 256-colour fonts:
  2303.      ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
  2304.           First, you should make a working directory for your font's data
  2305.           files.  For the sake of example, I will assume that you are
  2306.           trying to create MYFONT.FNT.
  2307.  
  2308.           Second, draw a bitmap for each of the 256 ASCII characters which
  2309.           you would like to exist in the font; if you won't be using a
  2310.           character, feel free to not bother drawing a bitmap for it.  Each
  2311.           bitmap should be as small as possible, so be sure not to leave
  2312.           any extra space around the character.  Use colour zero as the
  2313.           background colour, or some other colour if you would like the
  2314.           font to have a coloured background.  Save each of these bitmaps
  2315.           as a PCX file in the working directory.  Note that all character
  2316.           bitmaps must use the same colour palette.
  2317.  
  2318.           Third, convert the PCX files to RAW files by using PCX2RAW; to do
  2319.           so, type 'PCX2RAW *'.
  2320.  
  2321.           Fourth, you must rename one of the PAL files produced by PCX2RAW
  2322.           to MYFONT.PAL (remember MYFONT.FNT is the font you're creating).
  2323.           If you wish, you may delete all the other PAL files, so long as
  2324.           you leave MYFONT.PAL intact.
  2325.  
  2326.           Fifth, you must create MYFONT.OFF, the character offset
  2327.           description file.  This text file consists of 256 lines, each
  2328.           containing a single integer (either positive or zero), followed
  2329.           by a newline.  Each line contains its corresponding character's
  2330.           "offset from top" value; the first line is for character 0, the
  2331.           second is for character 1, and so on.  Given the (x,y)
  2332.           coordinates at which to put a character from the font, the
  2333.           "offset from top" is the value to add to the y coordinate before
  2334.           putImageInv() is called to display the character's bitmap.  The
  2335.           "offset from top" is used to make character bitmaps be written
  2336.           lower down on the screen than other bitmaps; for instance, the
  2337.           period character's offset would be greater than an asterisk's
  2338.           offset, because a period is lower down than an asterisk.
  2339.  
  2340.           Finally, you must create the font file MYFONT.FNT; to do so, type
  2341.           'MAKEFONT myfont'.
  2342.  
  2343.  
  2344.      For fixed-size monochrome fonts:
  2345.      ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
  2346.           TGE's font definition files must have a certain format which will
  2347.           be outlined below.  (Note that a fixed font consists of 256
  2348.           monochrome characters, each with the same dimensions.)
  2349.  
  2350.           The font file header consists of three fields of defined length.
  2351.           The first of these fields is the eight-byte font definition file
  2352.           signature string, which must be "TGEFONT1", without quotes or
  2353.           terminating null character.  The next field is a two-byte
  2354.           unsigned integer which holds the width of a character in pixels.
  2355.           The last field is also a two-byte integer, holding the height of
  2356.           a character in pixels.
  2357.  
  2358.           The remainder of the file consists of font data.  (If you have
  2359.           done advanced text programming before, you may recognize this
  2360.           data organization as the format used by the video BIOS.)  The
  2361.           characters are stored starting at character 0, all the way up to
  2362.           255.  Each of the characters is stored starting with the
  2363.           uppermost row, all the way down to the bottom row.  Each row is
  2364.           stored left to right, with the leftmost pixel in the most
  2365.           significant bit of the first byte in the row, and the rightmost
  2366.           pixel in the least significant bit of the last byte in the row.
  2367.           A 1 bit represents a foreground pixel, while a 0 bit represents a
  2368.           background pixel.  Note that, at present, font row widths must be
  2369.           evenly divisible by 8; pad with 0 bits if necessary.
  2370.  
  2371.           Image data for all 256 of the ASCII characters must be present in
  2372.           the file; if you won't be needing some of them, feel free to
  2373.           store zero bytes (or random bytes, if you're imaginative) as
  2374.           their image data.
  2375.  
  2376.  
  2377.  
  2378. USING PCX2RAW AND GRAPHICS FILES
  2379. flflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflfl
  2380.  
  2381.      The PCX2RAW utility provides a simple way to convert 256-colour images
  2382.      in PCX format into a format usable by TGE.  It is used like this:
  2383.  
  2384.           pcx2raw filename[.pcx]
  2385.  
  2386.      Given the PCX file FILENAME.PCX, PCX2RAW will create two new files in
  2387.      the same directory as FILENAME.PCX:  FILENAME.PAL which contains the
  2388.      colour palette from FILENAME.PCX, and FILENAME.RAW which is a TGE
  2389.      format bitmap of the image in FILENAME.PCX.  Following is a discussion
  2390.      of the PAL and RAW file formats, and how to use TGE's functions to
  2391.      access them.
  2392.  
  2393.  
  2394.      The PAL file is organized like this:
  2395.  
  2396.          Element size    Element description
  2397.          ------------    -------------------
  2398.            3 bytes           colour 0
  2399.            3 bytes           colour 1
  2400.                         .
  2401.                         .
  2402.                         .
  2403.            3 bytes           colour 254
  2404.            3 bytes           colour 255
  2405.  
  2406.      Each 3-byte element consists of the red, green, and blue colour
  2407.      components, in that order.  Each of these components is an unsigned
  2408.      char.  Code to load a PAL file is included in RAWFILE.C; the function
  2409.      description follows:
  2410.  
  2411.  *** Function:      loadPalFile()
  2412.      Syntax:        void far *loadPalFile(char *filename, void far *addr);
  2413.      Purpose:       Load a 768-byte palette file into memory.
  2414.      Parameters:    The palette data file 'filename' will be loaded into
  2415.                     the memory block at 'addr' (if 'addr' != NULL), or into
  2416.                     a newly allocated memory block (if 'addr' == NULL).
  2417.      Return value:  Returns the address of the loaded palette on success,
  2418.                     or NULL on error.
  2419.      Remarks:       If 'addr' is NULL, be sure to free() the allocated
  2420.                     memory block when the palette information is no longer
  2421.                     needed.
  2422.      See also:      loadPcxFilePal(), loadRawFile(), displayRawFile(),
  2423.                     loadPcxFile(), displayPcxFile()
  2424.  
  2425.  
  2426.      The RAW file is organized in exactly the same way as the bitmaps used
  2427.      by putImage() and its associated functions:  2 bytes for the image
  2428.      width, then 2 bytes for the image height, then width*height bytes (one
  2429.      per pixel) for the image information itself; the pixels are in order
  2430.      from left to right and from top to bottom, as one would read a book.
  2431.      The image dimension fields are both unsigned shorts, and are measured
  2432.      in pixels.  Code to deal with RAW files is included in RAWFILE.C; the
  2433.      function descriptions follow:
  2434.  
  2435.  *** Function:      loadRawFile()
  2436.      Syntax:        void far *loadRawFile(char *filename);
  2437.      Purpose:       Load a RAW image file into memory.
  2438.      Parameters:    The RAW image file 'filename' will be loaded into a
  2439.                     newly allocated memory block.
  2440.      Return value:  Returns the address of the loaded image on success, or
  2441.                     NULL on error.
  2442.      Remarks:       Be sure to free() the allocated memory block when the
  2443.                     image information is no longer needed.
  2444.      See also:      saveRawFile(), displayRawFile(), loadPcxFile(),
  2445.                     loadPalFile()
  2446.  
  2447.  *** Function:      displayRawFile()
  2448.      Syntax:        int displayRawFile(int x, int y, char *filename);
  2449.      Purpose:       Display a RAW image file.
  2450.      Parameters:    The RAW image file 'filename' will be displayed with
  2451.                     its upper-left corner at ('x','y').  Clipping is
  2452.                     performed.
  2453.      Return value:  Returns the 1 on success, or 0 on error.
  2454.      Remarks:       Since this function uses standard TGE output routines,
  2455.                     it can display to virtual screens as well as the real
  2456.                     screen.
  2457.      See also:      loadRawFile(), displayPcxFile(), loadPalFile()
  2458.  
  2459.  *** Function:      saveRawFile()
  2460.      Syntax:        int saveRawFile(char *filename, void *image);
  2461.      Purpose:       Save a RAW image to disk.
  2462.      Parameters:    The image at 'image' will be written to the RAW image
  2463.                     file 'filename'.
  2464.      Return value:  Returns 0 on error.
  2465.      Remarks:       None.
  2466.      See also:      loadRawFile(), loadPcxFile(), displayRawFile()
  2467.  
  2468.  
  2469.      TGE also includes routines to deal directly with PCX files:
  2470.  
  2471.  *** Function:      loadPcxFilePal()
  2472.      Syntax:        void far *loadPcxFilePal(char *filename, void far *addr);
  2473.      Purpose:       Load a 768-byte palette from a PCX file into memory.
  2474.      Parameters:    The palette data 'filename' will be loaded into the
  2475.                     memory block at 'addr' (if 'addr' != NULL), or into a
  2476.                     newly allocated memory block (if 'addr' == NULL).
  2477.      Return value:  Returns the address of the loaded palette on success,
  2478.                     or NULL on error.
  2479.      Remarks:       If 'addr' is NULL, be sure to free() the allocated
  2480.                     memory block when the palette information is no longer
  2481.                     needed.
  2482.      See also:      loadPalFile(), loadPcxFile(), displayPcxFile(),
  2483.                     loadRawFile(), displayRawFile()
  2484.  
  2485.  *** Function:      loadPcxFile()
  2486.      Syntax:        void far *loadPalFile(char *filename, void *palette);
  2487.      Purpose:       Load a PCX image file, and its palette if requested,
  2488.                     into memory.
  2489.      Parameters:    The PCX image file 'filename' will be loaded into a
  2490.                     newly allocated memory block.  If 'palette' is
  2491.                     non-NULL, the 768 bytes of palette data from the PCX
  2492.                     file will be loaded into the memory area at 'palette'.
  2493.      Return value:  Returns the address of the loaded image on success, or
  2494.                     NULL on error.  If 'palette' was non-NULL, a copy of
  2495.                     the palette will be at the memory area pointed to by
  2496.                     'palette' on return.
  2497.      Remarks:       Be sure to free() the allocated memory block when the
  2498.                     image information is no longer needed.
  2499.      See also:      displayPcxFile(), loadPcxFilePal(), loadRawFile(),
  2500.                     displayRawFile(), loadPalFile()
  2501.  
  2502.  *** Function:      displayPcxFile()
  2503.      Syntax:        int displayPcxFile(int x, int y, char *filename);
  2504.      Purpose:       Display a PCX image file.
  2505.      Parameters:    The PCX image file 'filename' will be displayed with
  2506.                     its upper-left corner at ('x','y').  Clipping is
  2507.                     performed.
  2508.      Return value:  Returns the 1 on success, or 0 on error.
  2509.      Remarks:            Since this function uses standard TGE output
  2510.                     routines, it can display to virtual screens as well as
  2511.                     the real screen.
  2512.                          The image is displayed using the current palette,
  2513.                     which is not necessarily the same as that of the PCX
  2514.                     file.
  2515.      See also:      loadPcxFile(), displayRawFile(), loadRawFile()
  2516.  
  2517.  
  2518.  
  2519. CONTACTING THE AUTHOR
  2520. flflflflflflflflflflflflflflflflflflflflfl
  2521.  
  2522.      I would appreciate hearing any questions, comments, bug reports, or
  2523.      suggestions for improvement.  If you have any, feel free to contact
  2524.      me; I can be reached via any of the methods below.  When reporting
  2525.      bugs, please be sure to mention the version of TGE to which you are
  2526.      referring; also, if possible, please include detailed descriptions of
  2527.      the problem and of your video hardware configuration.  If you have a
  2528.      video card which is not directly supported by TGE, I would appreciate
  2529.      it if you would send me programming information about your card and/or
  2530.      code to deal with it.
  2531.  
  2532.           Snail mail:      Matthew Hildebrand
  2533.                            4 College St.
  2534.                            St. Catharines, ON
  2535.                            Canada   L2R 2W7
  2536.  
  2537.           Fidonet mail:    1:247/128.2
  2538.                Please do not post personal messages to me in any of the
  2539.                Fidonet echos, such as C_ECHO or C_PLUSPLUS; such messages
  2540.                are off-topic and liable to annoy the moderator and other
  2541.                echo participants.  Use netmail instead.  If I find any such
  2542.                personal messages in Fidonet programming echos, I reply by
  2543.                netmail only.  If the matter being discussed would be of
  2544.                interest to other echo participants, I will reply in that
  2545.                echo.
  2546.  
  2547.           Internet mail:   Matthew.Hildebrand@p2.f128.n247.z1.fidonet.org
  2548.                Internet-Fidonet mail routing sometimes goes awry; if you
  2549.                don't get a reply from me after a reasonable amount of time,
  2550.                send the message again.  If you still don't receive a reply,
  2551.                either persist until you do or contact me via a different
  2552.                method.
  2553.  
  2554.           BBS:             (905)-935-6628
  2555.                I am not the sysop of idiot savant BBS, but I will receive
  2556.                messages left there for me.  The BBS runs a 14400 bps
  2557.                V.32bis modem.
  2558.  
  2559.           Telephone:       (905)-687-8736
  2560.                Please keep in mind the time zone difference, if any, when
  2561.                calling; I'm in Eastern Standard Time.
  2562.  
  2563.  
  2564.  
  2565. OBTAINING THE NEWEST VERSION OF TGE
  2566. flflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflfl
  2567.  
  2568.      The most recent distributed copy of TGE is available via first-call
  2569.      download from (905)-935-6628 (14400 bps V.32bis), or via file request
  2570.      from Fidonet node 1:247/128 (14400 bps V.32bis) using the magic file
  2571.      name "TGE"; unlisted nodes and points are welcome.  TGE is also
  2572.      distributed through the Fidonet file echo PDNCEE.
  2573.  
  2574.      If, after you have registered, you are interested in receiving new
  2575.      versions of TGE as they are released, an easy method is now available.
  2576.      For $3 per mailing (to cover the disk, envelope, and postage), I will
  2577.      mail copies of new versions as they are released, on either a 3.5" or
  2578.      a 5.25" disk.  The $3 per mailing may be included with the initial
  2579.      registration fee, with instructions to mail newer versions as they are
  2580.      released, or mailed later with a request for a copy of the newest
  2581.      version.  Please ensure that the $3 is paid in either US or Canadian
  2582.      funds; payment by cash, money order (use an international money order
  2583.      if necessary), or cheque drawn on a US or Canadian bank is acceptable.
  2584.  
  2585.      Alternatively, it is possible to receive notifications of updates but
  2586.      not the updates themselves.  For $1 per mailing (to cover the envelope
  2587.      and postage), I will mail notifications of new versions when they are
  2588.      released.  The $1 per mailing may be included with the initial
  2589.      registration fee, with instructions to mail notifications as new
  2590.      versions are released, or mailed later with similar instructions.
  2591.      Again, please ensure that the $1 is paid in either US or Canadian
  2592.      funds; payment by cash, money order (use an international money order
  2593.      if necessary), or cheque drawn on a US or Canadian bank is acceptable.
  2594.  
  2595.  
  2596.  
  2597. TROUBLESHOOTING
  2598. flflflflflflflflflflflflflflfl
  2599.  
  2600.      Q.   I get linker errors.  What's happening?
  2601.  
  2602.      A.   IF YOU ARE USING THE C++ PORTIONS OF TGE, YOU **MUST** DISABLE
  2603.           THE "FAR VIRTUAL TABLES" OPTION (-Vf- FROM THE COMMAND LINE).  IF
  2604.           YOU DO NOT, YOU WILL GET LINKER ERRORS COMPLAINING THAT CERTAIN
  2605.           CLASS MEMBER FUNCTIONS CANNOT BE FOUND.
  2606.  
  2607.  
  2608.      Q.   I'm a registered user, so I have a copy of TGE's source code.
  2609.           I've recompiled the library, and now putImage() and putImageInv()
  2610.           don't work correctly.  Why not?
  2611.  
  2612.      A.   When TGEFUNCS.C is compiled by Turbo C++ 3.0, putImage() and
  2613.           putImageInv() do not work correctly.  When informed of this bug,
  2614.           I stepped through the offending code at the assembly level, and
  2615.           discovered that this problem is caused by a bug in TC++, not TGE.
  2616.           The miscompiled lines of TGE.C are perfectly legal C statements;
  2617.           when TGE.C is compiled by my compiler (Borland C++ 2.0), TGE
  2618.           works correctly.  Using the TGEFUNCS.OBJ contained within one of
  2619.           the TGE library files, rather than OBJ files compiled by Turbo
  2620.           C++ 3.0, should solve the problem.
  2621.  
  2622.  
  2623.  
  2624. ACKNOWLEDGEMENT
  2625. flflflflflflflflflflflflflflfl
  2626.  
  2627.      There are many people whom I would like to thank for their
  2628.      suggestions, beta-testing, patience, registrations, and help with
  2629.      distribution.  You know who you are.
  2630.  
  2631.  
  2632.  
  2633. LEGAL STUFF
  2634. flflflflflflflflflflfl
  2635.  
  2636.      The Graphics Engine and its documentation are Copyright (c) 1993-1994
  2637.      by Matthew Hildebrand.
  2638.  
  2639.      All software and documentation associated with The Graphics Engine is
  2640.      provided "as is":  ie., it is provided without warranty of any kind,
  2641.      not even an implied warranty of merchantability or fitness for any
  2642.      purpose.  The Author (Matthew Hildebrand) disclaims all warranties,
  2643.      both express and implied, including but not limited to warranties
  2644.      regarding The Graphics Engine's merchantability or fitness for any
  2645.      particular purpose.
  2646.  
  2647.      The author may not be held liable for any damage or misfortune related
  2648.      to the use of this software.  Any usage of any or all of The Graphics
  2649.      Engine is done entirely at the user's risk.
  2650.  
  2651.      All registered trademarks in this document belong to their respective
  2652.      owners.
  2653.  
  2654.  
  2655.  
  2656. End of document.
  2657.